{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "第四章  变形"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>School</th>\n",
       "      <th>Class</th>\n",
       "      <th>ID</th>\n",
       "      <th>Gender</th>\n",
       "      <th>Address</th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "      <th>Math</th>\n",
       "      <th>Physics</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>S_1</td>\n",
       "      <td>C_1</td>\n",
       "      <td>1101</td>\n",
       "      <td>M</td>\n",
       "      <td>street_1</td>\n",
       "      <td>173</td>\n",
       "      <td>63</td>\n",
       "      <td>34.0</td>\n",
       "      <td>A+</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>S_1</td>\n",
       "      <td>C_1</td>\n",
       "      <td>1102</td>\n",
       "      <td>F</td>\n",
       "      <td>street_2</td>\n",
       "      <td>192</td>\n",
       "      <td>73</td>\n",
       "      <td>32.5</td>\n",
       "      <td>B+</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>S_1</td>\n",
       "      <td>C_1</td>\n",
       "      <td>1103</td>\n",
       "      <td>M</td>\n",
       "      <td>street_2</td>\n",
       "      <td>186</td>\n",
       "      <td>82</td>\n",
       "      <td>87.2</td>\n",
       "      <td>B+</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>S_1</td>\n",
       "      <td>C_1</td>\n",
       "      <td>1104</td>\n",
       "      <td>F</td>\n",
       "      <td>street_2</td>\n",
       "      <td>167</td>\n",
       "      <td>81</td>\n",
       "      <td>80.4</td>\n",
       "      <td>B-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>S_1</td>\n",
       "      <td>C_1</td>\n",
       "      <td>1105</td>\n",
       "      <td>F</td>\n",
       "      <td>street_4</td>\n",
       "      <td>159</td>\n",
       "      <td>64</td>\n",
       "      <td>84.8</td>\n",
       "      <td>B+</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  School Class    ID Gender   Address  Height  Weight  Math Physics\n",
       "0    S_1   C_1  1101      M  street_1     173      63  34.0      A+\n",
       "1    S_1   C_1  1102      F  street_2     192      73  32.5      B+\n",
       "2    S_1   C_1  1103      M  street_2     186      82  87.2      B+\n",
       "3    S_1   C_1  1104      F  street_2     167      81  80.4      B-\n",
       "4    S_1   C_1  1105      F  street_4     159      64  84.8      B+"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "df = pd.read_csv('data/table.csv')\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>Gender</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1101</th>\n",
       "      <td>NaN</td>\n",
       "      <td>173.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1102</th>\n",
       "      <td>192.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1103</th>\n",
       "      <td>NaN</td>\n",
       "      <td>186.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1104</th>\n",
       "      <td>167.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1105</th>\n",
       "      <td>159.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Gender      F      M\n",
       "ID                  \n",
       "1101      NaN  173.0\n",
       "1102    192.0    NaN\n",
       "1103      NaN  186.0\n",
       "1104    167.0    NaN\n",
       "1105    159.0    NaN"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.pivot_table(df,index='ID',columns='Gender',values='Height').head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">mean</th>\n",
       "      <th colspan=\"2\" halign=\"left\">sum</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Gender</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>School</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>S_1</th>\n",
       "      <td>173.125000</td>\n",
       "      <td>178.714286</td>\n",
       "      <td>1385</td>\n",
       "      <td>1251</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>S_2</th>\n",
       "      <td>173.727273</td>\n",
       "      <td>172.000000</td>\n",
       "      <td>1911</td>\n",
       "      <td>1548</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              mean               sum      \n",
       "Gender           F           M     F     M\n",
       "School                                    \n",
       "S_1     173.125000  178.714286  1385  1251\n",
       "S_2     173.727273  172.000000  1911  1548"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#aggfunc：对组内进行聚合统计\n",
    "pd.pivot_table(df,index='School',columns='Gender',values='Height',aggfunc=['mean','sum']).head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th colspan=\"3\" halign=\"left\">mean</th>\n",
       "      <th colspan=\"3\" halign=\"left\">sum</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Gender</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "      <th>All</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "      <th>All</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>School</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>S_1</th>\n",
       "      <td>173.125000</td>\n",
       "      <td>178.714286</td>\n",
       "      <td>175.733333</td>\n",
       "      <td>1385</td>\n",
       "      <td>1251</td>\n",
       "      <td>2636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>S_2</th>\n",
       "      <td>173.727273</td>\n",
       "      <td>172.000000</td>\n",
       "      <td>172.950000</td>\n",
       "      <td>1911</td>\n",
       "      <td>1548</td>\n",
       "      <td>3459</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>All</th>\n",
       "      <td>173.473684</td>\n",
       "      <td>174.937500</td>\n",
       "      <td>174.142857</td>\n",
       "      <td>3296</td>\n",
       "      <td>2799</td>\n",
       "      <td>6095</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              mean                           sum            \n",
       "Gender           F           M         All     F     M   All\n",
       "School                                                      \n",
       "S_1     173.125000  178.714286  175.733333  1385  1251  2636\n",
       "S_2     173.727273  172.000000  172.950000  1911  1548  3459\n",
       "All     173.473684  174.937500  174.142857  3296  2799  6095"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#margins：汇总边际状态\n",
    "pd.pivot_table(df,index='School',columns='Gender',values='Height',aggfunc=['mean','sum'],margins=True).head()\n",
    "#margins_name可以设置名字，默认为'All'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th colspan=\"10\" halign=\"left\">Height</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"10\" halign=\"left\">Weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th colspan=\"6\" halign=\"left\">F</th>\n",
       "      <th colspan=\"4\" halign=\"left\">M</th>\n",
       "      <th>...</th>\n",
       "      <th colspan=\"4\" halign=\"left\">F</th>\n",
       "      <th colspan=\"6\" halign=\"left\">M</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>Address</th>\n",
       "      <th>street_1</th>\n",
       "      <th>street_2</th>\n",
       "      <th>street_4</th>\n",
       "      <th>street_5</th>\n",
       "      <th>street_6</th>\n",
       "      <th>street_7</th>\n",
       "      <th>street_1</th>\n",
       "      <th>street_2</th>\n",
       "      <th>street_4</th>\n",
       "      <th>street_5</th>\n",
       "      <th>...</th>\n",
       "      <th>street_4</th>\n",
       "      <th>street_5</th>\n",
       "      <th>street_6</th>\n",
       "      <th>street_7</th>\n",
       "      <th>street_1</th>\n",
       "      <th>street_2</th>\n",
       "      <th>street_4</th>\n",
       "      <th>street_5</th>\n",
       "      <th>street_6</th>\n",
       "      <th>street_7</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>School</th>\n",
       "      <th>Class</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">S_1</th>\n",
       "      <th>C_1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>179.5</td>\n",
       "      <td>159.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>173.0</td>\n",
       "      <td>186.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>64.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>63.0</td>\n",
       "      <td>82.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C_2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>176.0</td>\n",
       "      <td>162.0</td>\n",
       "      <td>167.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>188.0</td>\n",
       "      <td>...</td>\n",
       "      <td>94.0</td>\n",
       "      <td>63.0</td>\n",
       "      <td>63.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>68.0</td>\n",
       "      <td>53.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C_3</th>\n",
       "      <td>175.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>187.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>195.0</td>\n",
       "      <td>161.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>69.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70.0</td>\n",
       "      <td>68.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"4\" valign=\"top\">S_2</th>\n",
       "      <th>C_1</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>159.0</td>\n",
       "      <td>161.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>163.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>97.0</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>71.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C_2</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>188.5</td>\n",
       "      <td>175.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>155.0</td>\n",
       "      <td>193.0</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.5</td>\n",
       "      <td>74.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>91.0</td>\n",
       "      <td>100.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C_3</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>157.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>164.0</td>\n",
       "      <td>190.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>187.0</td>\n",
       "      <td>171.0</td>\n",
       "      <td>...</td>\n",
       "      <td>78.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.0</td>\n",
       "      <td>99.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>73.0</td>\n",
       "      <td>88.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C_4</th>\n",
       "      <td>NaN</td>\n",
       "      <td>176.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>175.5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>...</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>57.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>7 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               Height                                                        \\\n",
       "Gender              F                                                     M   \n",
       "Address      street_1 street_2 street_4 street_5 street_6 street_7 street_1   \n",
       "School Class                                                                  \n",
       "S_1    C_1        NaN    179.5    159.0      NaN      NaN      NaN    173.0   \n",
       "       C_2        NaN      NaN    176.0    162.0    167.0      NaN      NaN   \n",
       "       C_3      175.0      NaN      NaN    187.0      NaN      NaN      NaN   \n",
       "S_2    C_1        NaN      NaN      NaN    159.0    161.0      NaN      NaN   \n",
       "       C_2        NaN      NaN      NaN      NaN      NaN    188.5    175.0   \n",
       "       C_3        NaN      NaN    157.0      NaN    164.0    190.0      NaN   \n",
       "       C_4        NaN    176.0      NaN      NaN    175.5      NaN      NaN   \n",
       "\n",
       "                                         ...   Weight                    \\\n",
       "Gender                                   ...        F                     \n",
       "Address      street_2 street_4 street_5  ... street_4 street_5 street_6   \n",
       "School Class                             ...                              \n",
       "S_1    C_1      186.0      NaN      NaN  ...     64.0      NaN      NaN   \n",
       "       C_2        NaN      NaN    188.0  ...     94.0     63.0     63.0   \n",
       "       C_3      195.0    161.0      NaN  ...      NaN     69.0      NaN   \n",
       "S_2    C_1        NaN    163.5      NaN  ...      NaN     97.0     61.0   \n",
       "       C_2        NaN    155.0    193.0  ...      NaN      NaN      NaN   \n",
       "       C_3        NaN    187.0    171.0  ...     78.0      NaN     81.0   \n",
       "       C_4        NaN      NaN      NaN  ...      NaN      NaN     57.0   \n",
       "\n",
       "                                                                             \n",
       "Gender                       M                                               \n",
       "Address      street_7 street_1 street_2 street_4 street_5 street_6 street_7  \n",
       "School Class                                                                 \n",
       "S_1    C_1        NaN     63.0     82.0      NaN      NaN      NaN      NaN  \n",
       "       C_2        NaN      NaN      NaN      NaN     68.0     53.0      NaN  \n",
       "       C_3        NaN      NaN     70.0     68.0      NaN      NaN     82.0  \n",
       "S_2    C_1        NaN      NaN      NaN     71.0      NaN      NaN     84.0  \n",
       "       C_2       76.5     74.0      NaN     91.0    100.0      NaN      NaN  \n",
       "       C_3       99.0      NaN      NaN     73.0     88.0      NaN      NaN  \n",
       "       C_4        NaN      NaN      NaN      NaN      NaN      NaN     82.0  \n",
       "\n",
       "[7 rows x 24 columns]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#行、列、值都可以为多级\n",
    "pd.pivot_table(df,index=['School','Class'],\n",
    "               columns=['Gender','Address'],\n",
    "               values=['Height','Weight'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>Gender</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Address</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>street_1</th>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_2</th>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_4</th>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_5</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_6</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_7</th>\n",
       "      <td>3</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Gender    F  M\n",
       "Address       \n",
       "street_1  1  2\n",
       "street_2  4  2\n",
       "street_4  3  5\n",
       "street_5  3  3\n",
       "street_6  5  1\n",
       "street_7  3  3"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#交叉表 \n",
    "#统计关于街道和性别分组的频数\n",
    "pd.crosstab(index=df['Address'],columns=df['Gender'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>Gender</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Address</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>street_1</th>\n",
       "      <td>175</td>\n",
       "      <td>173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_2</th>\n",
       "      <td>160</td>\n",
       "      <td>186</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_4</th>\n",
       "      <td>157</td>\n",
       "      <td>155</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_5</th>\n",
       "      <td>159</td>\n",
       "      <td>171</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_6</th>\n",
       "      <td>158</td>\n",
       "      <td>160</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_7</th>\n",
       "      <td>183</td>\n",
       "      <td>166</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Gender      F    M\n",
       "Address           \n",
       "street_1  175  173\n",
       "street_2  160  186\n",
       "street_4  157  155\n",
       "street_5  159  171\n",
       "street_6  158  160\n",
       "street_7  183  166"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# values和aggfunc：分组对某些数据进行聚合操作 values的作用是啥？？\n",
    "pd.crosstab(index=df['Address'],columns=df['Gender'],\n",
    "            values=df['Height'],aggfunc='min')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "还可以在获取交叉表之后，对数据进行标准化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th>Gender</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "      <th>All</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Address</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>street_1</th>\n",
       "      <td>0.028571</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.085714</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_2</th>\n",
       "      <td>0.114286</td>\n",
       "      <td>0.057143</td>\n",
       "      <td>0.171429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_4</th>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.228571</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_5</th>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.171429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_6</th>\n",
       "      <td>0.142857</td>\n",
       "      <td>0.028571</td>\n",
       "      <td>0.171429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>street_7</th>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.085714</td>\n",
       "      <td>0.171429</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>All</th>\n",
       "      <td>0.542857</td>\n",
       "      <td>0.457143</td>\n",
       "      <td>1.000000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "Gender           F         M       All\n",
       "Address                               \n",
       "street_1  0.028571  0.057143  0.085714\n",
       "street_2  0.114286  0.057143  0.171429\n",
       "street_4  0.085714  0.142857  0.228571\n",
       "street_5  0.085714  0.085714  0.171429\n",
       "street_6  0.142857  0.028571  0.171429\n",
       "street_7  0.085714  0.085714  0.171429\n",
       "All       0.542857  0.457143  1.000000"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.crosstab(index=df['Address'],columns=df['Gender'],normalize='all',margins=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "melt函数可以认为是pivot函数的逆操作。实际中用处应该不大"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th colspan=\"2\" halign=\"left\">Height</th>\n",
       "      <th colspan=\"2\" halign=\"left\">Weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Class</th>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">C_1</th>\n",
       "      <th>1101</th>\n",
       "      <td>NaN</td>\n",
       "      <td>173.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>63.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1102</th>\n",
       "      <td>192.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>73.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1103</th>\n",
       "      <td>NaN</td>\n",
       "      <td>186.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1104</th>\n",
       "      <td>167.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1105</th>\n",
       "      <td>159.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>64.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2101</th>\n",
       "      <td>NaN</td>\n",
       "      <td>174.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2102</th>\n",
       "      <td>161.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2103</th>\n",
       "      <td>NaN</td>\n",
       "      <td>157.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>61.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2104</th>\n",
       "      <td>159.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>97.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2105</th>\n",
       "      <td>NaN</td>\n",
       "      <td>170.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">C_2</th>\n",
       "      <th>1201</th>\n",
       "      <td>NaN</td>\n",
       "      <td>188.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1202</th>\n",
       "      <td>176.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>94.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1203</th>\n",
       "      <td>NaN</td>\n",
       "      <td>160.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>53.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1204</th>\n",
       "      <td>162.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>63.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1205</th>\n",
       "      <td>167.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>63.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2201</th>\n",
       "      <td>NaN</td>\n",
       "      <td>193.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2202</th>\n",
       "      <td>194.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>77.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2203</th>\n",
       "      <td>NaN</td>\n",
       "      <td>155.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>91.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2204</th>\n",
       "      <td>NaN</td>\n",
       "      <td>175.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2205</th>\n",
       "      <td>183.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>76.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">C_3</th>\n",
       "      <th>1301</th>\n",
       "      <td>NaN</td>\n",
       "      <td>161.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1302</th>\n",
       "      <td>175.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>57.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1303</th>\n",
       "      <td>NaN</td>\n",
       "      <td>188.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1304</th>\n",
       "      <td>NaN</td>\n",
       "      <td>195.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1305</th>\n",
       "      <td>187.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>69.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2301</th>\n",
       "      <td>157.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>78.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2302</th>\n",
       "      <td>NaN</td>\n",
       "      <td>171.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>88.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2303</th>\n",
       "      <td>190.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>99.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2304</th>\n",
       "      <td>164.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>81.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2305</th>\n",
       "      <td>NaN</td>\n",
       "      <td>187.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>73.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">C_4</th>\n",
       "      <th>2401</th>\n",
       "      <td>192.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>62.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2402</th>\n",
       "      <td>NaN</td>\n",
       "      <td>166.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2403</th>\n",
       "      <td>158.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>60.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2404</th>\n",
       "      <td>160.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>84.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2405</th>\n",
       "      <td>193.0</td>\n",
       "      <td>NaN</td>\n",
       "      <td>54.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           Height        Weight       \n",
       "Gender          F      M      F      M\n",
       "Class ID                              \n",
       "C_1   1101    NaN  173.0    NaN   63.0\n",
       "      1102  192.0    NaN   73.0    NaN\n",
       "      1103    NaN  186.0    NaN   82.0\n",
       "      1104  167.0    NaN   81.0    NaN\n",
       "      1105  159.0    NaN   64.0    NaN\n",
       "      2101    NaN  174.0    NaN   84.0\n",
       "      2102  161.0    NaN   61.0    NaN\n",
       "      2103    NaN  157.0    NaN   61.0\n",
       "      2104  159.0    NaN   97.0    NaN\n",
       "      2105    NaN  170.0    NaN   81.0\n",
       "C_2   1201    NaN  188.0    NaN   68.0\n",
       "      1202  176.0    NaN   94.0    NaN\n",
       "      1203    NaN  160.0    NaN   53.0\n",
       "      1204  162.0    NaN   63.0    NaN\n",
       "      1205  167.0    NaN   63.0    NaN\n",
       "      2201    NaN  193.0    NaN  100.0\n",
       "      2202  194.0    NaN   77.0    NaN\n",
       "      2203    NaN  155.0    NaN   91.0\n",
       "      2204    NaN  175.0    NaN   74.0\n",
       "      2205  183.0    NaN   76.0    NaN\n",
       "C_3   1301    NaN  161.0    NaN   68.0\n",
       "      1302  175.0    NaN   57.0    NaN\n",
       "      1303    NaN  188.0    NaN   82.0\n",
       "      1304    NaN  195.0    NaN   70.0\n",
       "      1305  187.0    NaN   69.0    NaN\n",
       "      2301  157.0    NaN   78.0    NaN\n",
       "      2302    NaN  171.0    NaN   88.0\n",
       "      2303  190.0    NaN   99.0    NaN\n",
       "      2304  164.0    NaN   81.0    NaN\n",
       "      2305    NaN  187.0    NaN   73.0\n",
       "C_4   2401  192.0    NaN   62.0    NaN\n",
       "      2402    NaN  166.0    NaN   82.0\n",
       "      2403  158.0    NaN   60.0    NaN\n",
       "      2404  160.0    NaN   84.0    NaN\n",
       "      2405  193.0    NaN   54.0    NaN"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_s = pd.pivot_table(df,index=['Class','ID'],columns='Gender',values=['Height','Weight'])\n",
    "df_s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>Height</th>\n",
       "      <th>Weight</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Class</th>\n",
       "      <th>ID</th>\n",
       "      <th>Gender</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">C_1</th>\n",
       "      <th>1101</th>\n",
       "      <th>M</th>\n",
       "      <td>173.0</td>\n",
       "      <td>63.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1102</th>\n",
       "      <th>F</th>\n",
       "      <td>192.0</td>\n",
       "      <td>73.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1103</th>\n",
       "      <th>M</th>\n",
       "      <td>186.0</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1104</th>\n",
       "      <th>F</th>\n",
       "      <td>167.0</td>\n",
       "      <td>81.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1105</th>\n",
       "      <th>F</th>\n",
       "      <td>159.0</td>\n",
       "      <td>64.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2101</th>\n",
       "      <th>M</th>\n",
       "      <td>174.0</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2102</th>\n",
       "      <th>F</th>\n",
       "      <td>161.0</td>\n",
       "      <td>61.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2103</th>\n",
       "      <th>M</th>\n",
       "      <td>157.0</td>\n",
       "      <td>61.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2104</th>\n",
       "      <th>F</th>\n",
       "      <td>159.0</td>\n",
       "      <td>97.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2105</th>\n",
       "      <th>M</th>\n",
       "      <td>170.0</td>\n",
       "      <td>81.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">C_2</th>\n",
       "      <th>1201</th>\n",
       "      <th>M</th>\n",
       "      <td>188.0</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1202</th>\n",
       "      <th>F</th>\n",
       "      <td>176.0</td>\n",
       "      <td>94.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1203</th>\n",
       "      <th>M</th>\n",
       "      <td>160.0</td>\n",
       "      <td>53.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1204</th>\n",
       "      <th>F</th>\n",
       "      <td>162.0</td>\n",
       "      <td>63.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1205</th>\n",
       "      <th>F</th>\n",
       "      <td>167.0</td>\n",
       "      <td>63.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2201</th>\n",
       "      <th>M</th>\n",
       "      <td>193.0</td>\n",
       "      <td>100.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2202</th>\n",
       "      <th>F</th>\n",
       "      <td>194.0</td>\n",
       "      <td>77.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2203</th>\n",
       "      <th>M</th>\n",
       "      <td>155.0</td>\n",
       "      <td>91.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2204</th>\n",
       "      <th>M</th>\n",
       "      <td>175.0</td>\n",
       "      <td>74.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2205</th>\n",
       "      <th>F</th>\n",
       "      <td>183.0</td>\n",
       "      <td>76.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">C_3</th>\n",
       "      <th>1301</th>\n",
       "      <th>M</th>\n",
       "      <td>161.0</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1302</th>\n",
       "      <th>F</th>\n",
       "      <td>175.0</td>\n",
       "      <td>57.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1303</th>\n",
       "      <th>M</th>\n",
       "      <td>188.0</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1304</th>\n",
       "      <th>M</th>\n",
       "      <td>195.0</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1305</th>\n",
       "      <th>F</th>\n",
       "      <td>187.0</td>\n",
       "      <td>69.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2301</th>\n",
       "      <th>F</th>\n",
       "      <td>157.0</td>\n",
       "      <td>78.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2302</th>\n",
       "      <th>M</th>\n",
       "      <td>171.0</td>\n",
       "      <td>88.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2303</th>\n",
       "      <th>F</th>\n",
       "      <td>190.0</td>\n",
       "      <td>99.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2304</th>\n",
       "      <th>F</th>\n",
       "      <td>164.0</td>\n",
       "      <td>81.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2305</th>\n",
       "      <th>M</th>\n",
       "      <td>187.0</td>\n",
       "      <td>73.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"5\" valign=\"top\">C_4</th>\n",
       "      <th>2401</th>\n",
       "      <th>F</th>\n",
       "      <td>192.0</td>\n",
       "      <td>62.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2402</th>\n",
       "      <th>M</th>\n",
       "      <td>166.0</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2403</th>\n",
       "      <th>F</th>\n",
       "      <td>158.0</td>\n",
       "      <td>60.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2404</th>\n",
       "      <th>F</th>\n",
       "      <td>160.0</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2405</th>\n",
       "      <th>F</th>\n",
       "      <td>193.0</td>\n",
       "      <td>54.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Height  Weight\n",
       "Class ID   Gender                \n",
       "C_1   1101 M        173.0    63.0\n",
       "      1102 F        192.0    73.0\n",
       "      1103 M        186.0    82.0\n",
       "      1104 F        167.0    81.0\n",
       "      1105 F        159.0    64.0\n",
       "      2101 M        174.0    84.0\n",
       "      2102 F        161.0    61.0\n",
       "      2103 M        157.0    61.0\n",
       "      2104 F        159.0    97.0\n",
       "      2105 M        170.0    81.0\n",
       "C_2   1201 M        188.0    68.0\n",
       "      1202 F        176.0    94.0\n",
       "      1203 M        160.0    53.0\n",
       "      1204 F        162.0    63.0\n",
       "      1205 F        167.0    63.0\n",
       "      2201 M        193.0   100.0\n",
       "      2202 F        194.0    77.0\n",
       "      2203 M        155.0    91.0\n",
       "      2204 M        175.0    74.0\n",
       "      2205 F        183.0    76.0\n",
       "C_3   1301 M        161.0    68.0\n",
       "      1302 F        175.0    57.0\n",
       "      1303 M        188.0    82.0\n",
       "      1304 M        195.0    70.0\n",
       "      1305 F        187.0    69.0\n",
       "      2301 F        157.0    78.0\n",
       "      2302 M        171.0    88.0\n",
       "      2303 F        190.0    99.0\n",
       "      2304 F        164.0    81.0\n",
       "      2305 M        187.0    73.0\n",
       "C_4   2401 F        192.0    62.0\n",
       "      2402 M        166.0    82.0\n",
       "      2403 F        158.0    60.0\n",
       "      2404 F        160.0    84.0\n",
       "      2405 F        193.0    54.0"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#stack：这是最基础的变形函数 可以简单理解为解压缩操作\n",
    "df_stacked = df_s.stack()\n",
    "df_stacked"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>Gender</th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Class</th>\n",
       "      <th>ID</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"20\" valign=\"top\">C_1</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">1101</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>173.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>63.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1102</th>\n",
       "      <th>Height</th>\n",
       "      <td>192.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>73.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1103</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>186.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1104</th>\n",
       "      <th>Height</th>\n",
       "      <td>167.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>81.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1105</th>\n",
       "      <th>Height</th>\n",
       "      <td>159.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>64.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2101</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>174.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>84.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2102</th>\n",
       "      <th>Height</th>\n",
       "      <td>161.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>61.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2103</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>157.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>61.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2104</th>\n",
       "      <th>Height</th>\n",
       "      <td>159.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>97.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2105</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>170.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>81.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">C_2</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">1201</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>188.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1202</th>\n",
       "      <th>Height</th>\n",
       "      <td>176.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>94.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1203</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>160.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>53.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1204</th>\n",
       "      <th>Height</th>\n",
       "      <td>162.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>63.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1205</th>\n",
       "      <th>Height</th>\n",
       "      <td>167.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>63.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"20\" valign=\"top\">C_3</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">1301</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>161.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>68.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1302</th>\n",
       "      <th>Height</th>\n",
       "      <td>175.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>57.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1303</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>188.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1304</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>195.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>70.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1305</th>\n",
       "      <th>Height</th>\n",
       "      <td>187.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>69.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2301</th>\n",
       "      <th>Height</th>\n",
       "      <td>157.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>78.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2302</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>171.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>88.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2303</th>\n",
       "      <th>Height</th>\n",
       "      <td>190.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>99.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2304</th>\n",
       "      <th>Height</th>\n",
       "      <td>164.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>81.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2305</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>187.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>73.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"10\" valign=\"top\">C_4</th>\n",
       "      <th rowspan=\"2\" valign=\"top\">2401</th>\n",
       "      <th>Height</th>\n",
       "      <td>192.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>62.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2402</th>\n",
       "      <th>Height</th>\n",
       "      <td>NaN</td>\n",
       "      <td>166.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>NaN</td>\n",
       "      <td>82.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2403</th>\n",
       "      <th>Height</th>\n",
       "      <td>158.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>60.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2404</th>\n",
       "      <th>Height</th>\n",
       "      <td>160.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>84.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2405</th>\n",
       "      <th>Height</th>\n",
       "      <td>193.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Weight</th>\n",
       "      <td>54.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>70 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "Gender                 F      M\n",
       "Class ID                       \n",
       "C_1   1101 Height    NaN  173.0\n",
       "           Weight    NaN   63.0\n",
       "      1102 Height  192.0    NaN\n",
       "           Weight   73.0    NaN\n",
       "      1103 Height    NaN  186.0\n",
       "           Weight    NaN   82.0\n",
       "      1104 Height  167.0    NaN\n",
       "           Weight   81.0    NaN\n",
       "      1105 Height  159.0    NaN\n",
       "           Weight   64.0    NaN\n",
       "      2101 Height    NaN  174.0\n",
       "           Weight    NaN   84.0\n",
       "      2102 Height  161.0    NaN\n",
       "           Weight   61.0    NaN\n",
       "      2103 Height    NaN  157.0\n",
       "           Weight    NaN   61.0\n",
       "      2104 Height  159.0    NaN\n",
       "           Weight   97.0    NaN\n",
       "      2105 Height    NaN  170.0\n",
       "           Weight    NaN   81.0\n",
       "C_2   1201 Height    NaN  188.0\n",
       "           Weight    NaN   68.0\n",
       "      1202 Height  176.0    NaN\n",
       "           Weight   94.0    NaN\n",
       "      1203 Height    NaN  160.0\n",
       "           Weight    NaN   53.0\n",
       "      1204 Height  162.0    NaN\n",
       "           Weight   63.0    NaN\n",
       "      1205 Height  167.0    NaN\n",
       "           Weight   63.0    NaN\n",
       "...                  ...    ...\n",
       "C_3   1301 Height    NaN  161.0\n",
       "           Weight    NaN   68.0\n",
       "      1302 Height  175.0    NaN\n",
       "           Weight   57.0    NaN\n",
       "      1303 Height    NaN  188.0\n",
       "           Weight    NaN   82.0\n",
       "      1304 Height    NaN  195.0\n",
       "           Weight    NaN   70.0\n",
       "      1305 Height  187.0    NaN\n",
       "           Weight   69.0    NaN\n",
       "      2301 Height  157.0    NaN\n",
       "           Weight   78.0    NaN\n",
       "      2302 Height    NaN  171.0\n",
       "           Weight    NaN   88.0\n",
       "      2303 Height  190.0    NaN\n",
       "           Weight   99.0    NaN\n",
       "      2304 Height  164.0    NaN\n",
       "           Weight   81.0    NaN\n",
       "      2305 Height    NaN  187.0\n",
       "           Weight    NaN   73.0\n",
       "C_4   2401 Height  192.0    NaN\n",
       "           Weight   62.0    NaN\n",
       "      2402 Height    NaN  166.0\n",
       "           Weight    NaN   82.0\n",
       "      2403 Height  158.0    NaN\n",
       "           Weight   60.0    NaN\n",
       "      2404 Height  160.0    NaN\n",
       "           Weight   84.0    NaN\n",
       "      2405 Height  193.0    NaN\n",
       "           Weight   54.0    NaN\n",
       "\n",
       "[70 rows x 2 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#stack函数可看作将横向的索引放到纵向，level可指定变化的列索引是哪一层\n",
    "df_stacked = df_s.stack(0)\n",
    "df_stacked"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "get_dummies函数，其功能主要是进行one-hot编码，建模的时候常用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>F</th>\n",
       "      <th>M</th>\n",
       "      <th>Weight</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>64</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>94</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>53</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>68</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>69</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>97</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>77</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>91</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>74</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>76</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>88</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>99</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>73</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>62</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>84</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>34</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>54</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    F  M  Weight\n",
       "0   0  1      63\n",
       "1   1  0      73\n",
       "2   0  1      82\n",
       "3   1  0      81\n",
       "4   1  0      64\n",
       "5   0  1      68\n",
       "6   1  0      94\n",
       "7   0  1      53\n",
       "8   1  0      63\n",
       "9   1  0      63\n",
       "10  0  1      68\n",
       "11  1  0      57\n",
       "12  0  1      82\n",
       "13  0  1      70\n",
       "14  1  0      69\n",
       "15  0  1      84\n",
       "16  1  0      61\n",
       "17  0  1      61\n",
       "18  1  0      97\n",
       "19  0  1      81\n",
       "20  0  1     100\n",
       "21  1  0      77\n",
       "22  0  1      91\n",
       "23  0  1      74\n",
       "24  1  0      76\n",
       "25  1  0      78\n",
       "26  0  1      88\n",
       "27  1  0      99\n",
       "28  1  0      81\n",
       "29  0  1      73\n",
       "30  1  0      62\n",
       "31  0  1      82\n",
       "32  1  0      60\n",
       "33  1  0      84\n",
       "34  1  0      54"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_d = df[['Class','Gender','Weight']]\n",
    "pd.get_dummies(df_d['Gender']).join(df_d['Weight'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " factorize方法，该方法会返回两个返回值，，主要用于自然数编码，并且缺失值会被记为-1，sort参数表示是否排序后赋值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1, -1,  0,  2,  1], dtype=int64)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "array(['a', 'b', 'c'], dtype=object)"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "codes, uniques = pd.factorize(['b', None, 'a', 'c', 'b'], sort=True)\n",
    "display(codes)\n",
    "display(uniques)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>YYYY</th>\n",
       "      <th>State</th>\n",
       "      <th>COUNTY</th>\n",
       "      <th>SubstanceName</th>\n",
       "      <th>DrugReports</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>ACCOMACK</td>\n",
       "      <td>Propoxyphene</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ADAMS</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>ADAMS</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>ALEXANDRIA CITY</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>ALLEGHENY</td>\n",
       "      <td>Hydromorphone</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>AMELIA</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>ARLINGTON</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>ARMSTRONG</td>\n",
       "      <td>Dextropropoxyphene</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ASHLAND</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ASHLAND</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ASHTABULA</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ASHTABULA</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ATHENS</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ATHENS</td>\n",
       "      <td>Propoxyphene</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>AUGLAIZE</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>AUGLAIZE</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>AUGLAIZE</td>\n",
       "      <td>Propoxyphene</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2010</td>\n",
       "      <td>WV</td>\n",
       "      <td>BARBOUR</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BARREN</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BATH</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BATH</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>BEDFORD</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>BEDFORD</td>\n",
       "      <td>Meperidine</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BELL</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>148</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BELL</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2010</td>\n",
       "      <td>WV</td>\n",
       "      <td>BERKELEY</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>BERKS</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>BLAND</td>\n",
       "      <td>Propoxyphene</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24032</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WASHINGTON</td>\n",
       "      <td>Carfentanil</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24033</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WASHINGTON</td>\n",
       "      <td>Acetyl fentanyl</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24034</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WASHINGTON</td>\n",
       "      <td>Furanyl fentanyl</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24035</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WASHINGTON</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24036</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WAYNE</td>\n",
       "      <td>Acryl fentanyl</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24037</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WAYNE</td>\n",
       "      <td>U-47700</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24038</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WAYNE</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24039</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WAYNESBORO CITY</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24040</th>\n",
       "      <td>2017</td>\n",
       "      <td>WV</td>\n",
       "      <td>WEBSTER</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24041</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WESTMORELAND</td>\n",
       "      <td>Acryl fentanyl</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24042</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WESTMORELAND</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24043</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WESTMORELAND</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24044</th>\n",
       "      <td>2017</td>\n",
       "      <td>KY</td>\n",
       "      <td>WHITLEY</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24045</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WINCHESTER CITY</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24046</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WINCHESTER CITY</td>\n",
       "      <td>Hydromorphone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24047</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WISE</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24048</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WISE</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24049</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24050</th>\n",
       "      <td>2017</td>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Acetyl fentanyl</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24051</th>\n",
       "      <td>2017</td>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24052</th>\n",
       "      <td>2017</td>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24053</th>\n",
       "      <td>2017</td>\n",
       "      <td>KY</td>\n",
       "      <td>WOODFORD</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24054</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WYANDOT</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24055</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WYANDOT</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24056</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WYOMING</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24057</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WYTHE</td>\n",
       "      <td>Codeine</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24058</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WYTHE</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24059</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WYTHE</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24060</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>YORK</td>\n",
       "      <td>ANPP</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24061</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>YORK</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>48</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>24062 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       YYYY State           COUNTY       SubstanceName  DrugReports\n",
       "0      2010    VA         ACCOMACK        Propoxyphene            1\n",
       "1      2010    OH            ADAMS            Morphine            9\n",
       "2      2010    PA            ADAMS           Methadone            2\n",
       "3      2010    VA  ALEXANDRIA CITY              Heroin            5\n",
       "4      2010    PA        ALLEGHENY       Hydromorphone            5\n",
       "5      2010    KY            ALLEN           Oxycodone           15\n",
       "6      2010    KY            ALLEN         Oxymorphone            1\n",
       "7      2010    VA           AMELIA              Heroin            1\n",
       "8      2010    VA        ARLINGTON              Heroin           41\n",
       "9      2010    PA        ARMSTRONG  Dextropropoxyphene            1\n",
       "10     2010    OH          ASHLAND           Oxycodone           45\n",
       "11     2010    OH          ASHLAND         Oxymorphone            2\n",
       "12     2010    OH        ASHTABULA       Buprenorphine            7\n",
       "13     2010    OH        ASHTABULA         Hydrocodone           21\n",
       "14     2010    OH           ATHENS              Heroin           72\n",
       "15     2010    OH           ATHENS        Propoxyphene            1\n",
       "16     2010    OH         AUGLAIZE              Heroin           35\n",
       "17     2010    OH         AUGLAIZE           Methadone            1\n",
       "18     2010    OH         AUGLAIZE        Propoxyphene            2\n",
       "19     2010    WV          BARBOUR           Oxycodone            1\n",
       "20     2010    KY           BARREN            Morphine            3\n",
       "21     2010    KY             BATH       Buprenorphine            1\n",
       "22     2010    KY             BATH         Hydrocodone            7\n",
       "23     2010    PA          BEDFORD         Hydrocodone            3\n",
       "24     2010    VA          BEDFORD          Meperidine            1\n",
       "25     2010    KY             BELL           Oxycodone          148\n",
       "26     2010    KY             BELL         Oxymorphone            3\n",
       "27     2010    WV         BERKELEY         Hydrocodone            6\n",
       "28     2010    PA            BERKS            Morphine            5\n",
       "29     2010    VA            BLAND        Propoxyphene            1\n",
       "...     ...   ...              ...                 ...          ...\n",
       "24032  2017    OH       WASHINGTON         Carfentanil            5\n",
       "24033  2017    PA       WASHINGTON     Acetyl fentanyl            2\n",
       "24034  2017    PA       WASHINGTON    Furanyl fentanyl           12\n",
       "24035  2017    VA       WASHINGTON            Tramadol            1\n",
       "24036  2017    OH            WAYNE      Acryl fentanyl            5\n",
       "24037  2017    OH            WAYNE             U-47700            7\n",
       "24038  2017    PA            WAYNE           Methadone            1\n",
       "24039  2017    VA  WAYNESBORO CITY            Fentanyl            1\n",
       "24040  2017    WV          WEBSTER           Oxycodone            3\n",
       "24041  2017    PA     WESTMORELAND      Acryl fentanyl            2\n",
       "24042  2017    VA     WESTMORELAND       Buprenorphine            2\n",
       "24043  2017    VA     WESTMORELAND            Morphine            3\n",
       "24044  2017    KY          WHITLEY       Buprenorphine           15\n",
       "24045  2017    VA  WINCHESTER CITY            Fentanyl            4\n",
       "24046  2017    VA  WINCHESTER CITY       Hydromorphone            1\n",
       "24047  2017    VA             WISE           Oxycodone           23\n",
       "24048  2017    VA             WISE         Oxymorphone            2\n",
       "24049  2017    OH             WOOD            Tramadol            1\n",
       "24050  2017    WV             WOOD     Acetyl fentanyl            1\n",
       "24051  2017    WV             WOOD       Buprenorphine            4\n",
       "24052  2017    WV             WOOD            Tramadol            3\n",
       "24053  2017    KY         WOODFORD            Morphine            1\n",
       "24054  2017    OH          WYANDOT            Fentanyl            3\n",
       "24055  2017    OH          WYANDOT         Hydrocodone            6\n",
       "24056  2017    PA          WYOMING              Heroin           20\n",
       "24057  2017    VA            WYTHE             Codeine            1\n",
       "24058  2017    VA            WYTHE         Hydrocodone           19\n",
       "24059  2017    VA            WYTHE            Tramadol            5\n",
       "24060  2017    PA             YORK                ANPP            1\n",
       "24061  2017    VA             YORK              Heroin           48\n",
       "\n",
       "[24062 rows x 5 columns]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#练习1：\n",
    "df = pd.read_csv('data/Drugs.csv')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "#问题一\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>YYYY</th>\n",
       "      <th>State</th>\n",
       "      <th>COUNTY</th>\n",
       "      <th>SubstanceName</th>\n",
       "      <th>DrugReports</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>ACCOMACK</td>\n",
       "      <td>Propoxyphene</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ADAMS</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>ADAMS</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>ALEXANDRIA CITY</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>ALLEGHENY</td>\n",
       "      <td>Hydromorphone</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>AMELIA</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>ARLINGTON</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>ARMSTRONG</td>\n",
       "      <td>Dextropropoxyphene</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ASHLAND</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>45</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ASHLAND</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ASHTABULA</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ASHTABULA</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>21</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ATHENS</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>72</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>ATHENS</td>\n",
       "      <td>Propoxyphene</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>AUGLAIZE</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>AUGLAIZE</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2010</td>\n",
       "      <td>OH</td>\n",
       "      <td>AUGLAIZE</td>\n",
       "      <td>Propoxyphene</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2010</td>\n",
       "      <td>WV</td>\n",
       "      <td>BARBOUR</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BARREN</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BATH</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BATH</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>BEDFORD</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>BEDFORD</td>\n",
       "      <td>Meperidine</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BELL</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>148</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2010</td>\n",
       "      <td>KY</td>\n",
       "      <td>BELL</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2010</td>\n",
       "      <td>WV</td>\n",
       "      <td>BERKELEY</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2010</td>\n",
       "      <td>PA</td>\n",
       "      <td>BERKS</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2010</td>\n",
       "      <td>VA</td>\n",
       "      <td>BLAND</td>\n",
       "      <td>Propoxyphene</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24032</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WASHINGTON</td>\n",
       "      <td>Carfentanil</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24033</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WASHINGTON</td>\n",
       "      <td>Acetyl fentanyl</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24034</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WASHINGTON</td>\n",
       "      <td>Furanyl fentanyl</td>\n",
       "      <td>12</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24035</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WASHINGTON</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24036</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WAYNE</td>\n",
       "      <td>Acryl fentanyl</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24037</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WAYNE</td>\n",
       "      <td>U-47700</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24038</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WAYNE</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24039</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WAYNESBORO CITY</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24040</th>\n",
       "      <td>2017</td>\n",
       "      <td>WV</td>\n",
       "      <td>WEBSTER</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24041</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WESTMORELAND</td>\n",
       "      <td>Acryl fentanyl</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24042</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WESTMORELAND</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24043</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WESTMORELAND</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24044</th>\n",
       "      <td>2017</td>\n",
       "      <td>KY</td>\n",
       "      <td>WHITLEY</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24045</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WINCHESTER CITY</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24046</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WINCHESTER CITY</td>\n",
       "      <td>Hydromorphone</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24047</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WISE</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24048</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WISE</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24049</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24050</th>\n",
       "      <td>2017</td>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Acetyl fentanyl</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24051</th>\n",
       "      <td>2017</td>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24052</th>\n",
       "      <td>2017</td>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24053</th>\n",
       "      <td>2017</td>\n",
       "      <td>KY</td>\n",
       "      <td>WOODFORD</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24054</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WYANDOT</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24055</th>\n",
       "      <td>2017</td>\n",
       "      <td>OH</td>\n",
       "      <td>WYANDOT</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24056</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>WYOMING</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24057</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WYTHE</td>\n",
       "      <td>Codeine</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24058</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WYTHE</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24059</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>WYTHE</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24060</th>\n",
       "      <td>2017</td>\n",
       "      <td>PA</td>\n",
       "      <td>YORK</td>\n",
       "      <td>ANPP</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24061</th>\n",
       "      <td>2017</td>\n",
       "      <td>VA</td>\n",
       "      <td>YORK</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>48</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>24062 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       YYYY State           COUNTY       SubstanceName  DrugReports\n",
       "0      2010    VA         ACCOMACK        Propoxyphene            1\n",
       "1      2010    OH            ADAMS            Morphine            9\n",
       "2      2010    PA            ADAMS           Methadone            2\n",
       "3      2010    VA  ALEXANDRIA CITY              Heroin            5\n",
       "4      2010    PA        ALLEGHENY       Hydromorphone            5\n",
       "5      2010    KY            ALLEN           Oxycodone           15\n",
       "6      2010    KY            ALLEN         Oxymorphone            1\n",
       "7      2010    VA           AMELIA              Heroin            1\n",
       "8      2010    VA        ARLINGTON              Heroin           41\n",
       "9      2010    PA        ARMSTRONG  Dextropropoxyphene            1\n",
       "10     2010    OH          ASHLAND           Oxycodone           45\n",
       "11     2010    OH          ASHLAND         Oxymorphone            2\n",
       "12     2010    OH        ASHTABULA       Buprenorphine            7\n",
       "13     2010    OH        ASHTABULA         Hydrocodone           21\n",
       "14     2010    OH           ATHENS              Heroin           72\n",
       "15     2010    OH           ATHENS        Propoxyphene            1\n",
       "16     2010    OH         AUGLAIZE              Heroin           35\n",
       "17     2010    OH         AUGLAIZE           Methadone            1\n",
       "18     2010    OH         AUGLAIZE        Propoxyphene            2\n",
       "19     2010    WV          BARBOUR           Oxycodone            1\n",
       "20     2010    KY           BARREN            Morphine            3\n",
       "21     2010    KY             BATH       Buprenorphine            1\n",
       "22     2010    KY             BATH         Hydrocodone            7\n",
       "23     2010    PA          BEDFORD         Hydrocodone            3\n",
       "24     2010    VA          BEDFORD          Meperidine            1\n",
       "25     2010    KY             BELL           Oxycodone          148\n",
       "26     2010    KY             BELL         Oxymorphone            3\n",
       "27     2010    WV         BERKELEY         Hydrocodone            6\n",
       "28     2010    PA            BERKS            Morphine            5\n",
       "29     2010    VA            BLAND        Propoxyphene            1\n",
       "...     ...   ...              ...                 ...          ...\n",
       "24032  2017    OH       WASHINGTON         Carfentanil            5\n",
       "24033  2017    PA       WASHINGTON     Acetyl fentanyl            2\n",
       "24034  2017    PA       WASHINGTON    Furanyl fentanyl           12\n",
       "24035  2017    VA       WASHINGTON            Tramadol            1\n",
       "24036  2017    OH            WAYNE      Acryl fentanyl            5\n",
       "24037  2017    OH            WAYNE             U-47700            7\n",
       "24038  2017    PA            WAYNE           Methadone            1\n",
       "24039  2017    VA  WAYNESBORO CITY            Fentanyl            1\n",
       "24040  2017    WV          WEBSTER           Oxycodone            3\n",
       "24041  2017    PA     WESTMORELAND      Acryl fentanyl            2\n",
       "24042  2017    VA     WESTMORELAND       Buprenorphine            2\n",
       "24043  2017    VA     WESTMORELAND            Morphine            3\n",
       "24044  2017    KY          WHITLEY       Buprenorphine           15\n",
       "24045  2017    VA  WINCHESTER CITY            Fentanyl            4\n",
       "24046  2017    VA  WINCHESTER CITY       Hydromorphone            1\n",
       "24047  2017    VA             WISE           Oxycodone           23\n",
       "24048  2017    VA             WISE         Oxymorphone            2\n",
       "24049  2017    OH             WOOD            Tramadol            1\n",
       "24050  2017    WV             WOOD     Acetyl fentanyl            1\n",
       "24051  2017    WV             WOOD       Buprenorphine            4\n",
       "24052  2017    WV             WOOD            Tramadol            3\n",
       "24053  2017    KY         WOODFORD            Morphine            1\n",
       "24054  2017    OH          WYANDOT            Fentanyl            3\n",
       "24055  2017    OH          WYANDOT         Hydrocodone            6\n",
       "24056  2017    PA          WYOMING              Heroin           20\n",
       "24057  2017    VA            WYTHE             Codeine            1\n",
       "24058  2017    VA            WYTHE         Hydrocodone           19\n",
       "24059  2017    VA            WYTHE            Tramadol            5\n",
       "24060  2017    PA             YORK                ANPP            1\n",
       "24061  2017    VA             YORK              Heroin           48\n",
       "\n",
       "[24062 rows x 5 columns]"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('data/Drugs.csv').sort_index()\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>COUNTY</th>\n",
       "      <th>SubstanceName</th>\n",
       "      <th>2010</th>\n",
       "      <th>2011</th>\n",
       "      <th>2012</th>\n",
       "      <th>2013</th>\n",
       "      <th>2014</th>\n",
       "      <th>2015</th>\n",
       "      <th>2016</th>\n",
       "      <th>2017</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>-</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>27</td>\n",
       "      <td>5</td>\n",
       "      <td>7</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Codeine</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>6</td>\n",
       "      <td>9</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>9</td>\n",
       "      <td>7</td>\n",
       "      <td>11</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Hydromorphone</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>-</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>9</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>KY</td>\n",
       "      <td>ADAIR</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Codeine</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>10</td>\n",
       "      <td>4</td>\n",
       "      <td>57</td>\n",
       "      <td>12</td>\n",
       "      <td>9</td>\n",
       "      <td>8</td>\n",
       "      <td>15</td>\n",
       "      <td>14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Hydromorphone</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>15</td>\n",
       "      <td>5</td>\n",
       "      <td>19</td>\n",
       "      <td>8</td>\n",
       "      <td>9</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>KY</td>\n",
       "      <td>ALLEN</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>18</td>\n",
       "      <td>20</td>\n",
       "      <td>12</td>\n",
       "      <td>16</td>\n",
       "      <td>13</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>7</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Hydromorphone</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Methorphan</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>21</td>\n",
       "      <td>23</td>\n",
       "      <td>3</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Oxymorphone</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>KY</td>\n",
       "      <td>ANDERSON</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6184</th>\n",
       "      <td>WV</td>\n",
       "      <td>WEBSTER</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6185</th>\n",
       "      <td>WV</td>\n",
       "      <td>WEBSTER</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>-</td>\n",
       "      <td>3</td>\n",
       "      <td>-</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6186</th>\n",
       "      <td>WV</td>\n",
       "      <td>WEBSTER</td>\n",
       "      <td>Pentazocine</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6187</th>\n",
       "      <td>WV</td>\n",
       "      <td>WETZEL</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6188</th>\n",
       "      <td>WV</td>\n",
       "      <td>WETZEL</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>4</td>\n",
       "      <td>19</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "      <td>17</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6189</th>\n",
       "      <td>WV</td>\n",
       "      <td>WETZEL</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6190</th>\n",
       "      <td>WV</td>\n",
       "      <td>WETZEL</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6191</th>\n",
       "      <td>WV</td>\n",
       "      <td>WETZEL</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>3</td>\n",
       "      <td>-</td>\n",
       "      <td>8</td>\n",
       "      <td>6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6192</th>\n",
       "      <td>WV</td>\n",
       "      <td>WIRT</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6193</th>\n",
       "      <td>WV</td>\n",
       "      <td>WIRT</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6194</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Acetyl fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>20</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6195</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Acryl fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6196</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>8</td>\n",
       "      <td>7</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6197</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Butyryl fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6198</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Codeine</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6199</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Dextropropoxyphene</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6200</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>12</td>\n",
       "      <td>2</td>\n",
       "      <td>18</td>\n",
       "      <td>63</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6201</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Furanyl fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6202</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Furanyl/3-Furanyl fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6203</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Heroin</td>\n",
       "      <td>60</td>\n",
       "      <td>4</td>\n",
       "      <td>27</td>\n",
       "      <td>127</td>\n",
       "      <td>90</td>\n",
       "      <td>125</td>\n",
       "      <td>137</td>\n",
       "      <td>144</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6204</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>15</td>\n",
       "      <td>4</td>\n",
       "      <td>17</td>\n",
       "      <td>21</td>\n",
       "      <td>29</td>\n",
       "      <td>21</td>\n",
       "      <td>11</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6205</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Hydromorphone</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6206</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Isobutyryl fentanyl</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6207</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Methadone</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6208</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Morphine</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6209</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>6</td>\n",
       "      <td>4</td>\n",
       "      <td>24</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>11</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6210</th>\n",
       "      <td>WV</td>\n",
       "      <td>WOOD</td>\n",
       "      <td>Tramadol</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>4</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6211</th>\n",
       "      <td>WV</td>\n",
       "      <td>WYOMING</td>\n",
       "      <td>Buprenorphine</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6212</th>\n",
       "      <td>WV</td>\n",
       "      <td>WYOMING</td>\n",
       "      <td>Hydrocodone</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6213</th>\n",
       "      <td>WV</td>\n",
       "      <td>WYOMING</td>\n",
       "      <td>Oxycodone</td>\n",
       "      <td>5</td>\n",
       "      <td>4</td>\n",
       "      <td>14</td>\n",
       "      <td>12</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>6214 rows × 11 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     State    COUNTY               SubstanceName 2010 2011 2012 2013 2014  \\\n",
       "0       KY     ADAIR               Buprenorphine    -    3    5    4   27   \n",
       "1       KY     ADAIR                     Codeine    -    -    1    -    -   \n",
       "2       KY     ADAIR                    Fentanyl    -    -    1    -    -   \n",
       "3       KY     ADAIR                      Heroin    -    -    1    2    -   \n",
       "4       KY     ADAIR                 Hydrocodone    6    9   10   10    9   \n",
       "5       KY     ADAIR               Hydromorphone    -    -    1    -    -   \n",
       "6       KY     ADAIR                   Methadone    1    -    1    -    -   \n",
       "7       KY     ADAIR                    Morphine    -    2    4    -    -   \n",
       "8       KY     ADAIR                   Oxycodone    -    4    1    1    9   \n",
       "9       KY     ADAIR                    Tramadol    -    1    -    -    -   \n",
       "10      KY     ALLEN               Buprenorphine    -    1    -    -    3   \n",
       "11      KY     ALLEN                     Codeine    -    -    1    -    -   \n",
       "12      KY     ALLEN                      Heroin    -    -    -    -    -   \n",
       "13      KY     ALLEN                 Hydrocodone   10    4   57   12    9   \n",
       "14      KY     ALLEN               Hydromorphone    -    1    2    2    2   \n",
       "15      KY     ALLEN                   Methadone    4    -    5    -    3   \n",
       "16      KY     ALLEN                    Morphine    -    5    5    1    3   \n",
       "17      KY     ALLEN                   Oxycodone   15    5   19    8    9   \n",
       "18      KY     ALLEN                 Oxymorphone    1    1    2    -    1   \n",
       "19      KY  ANDERSON               Buprenorphine    1    1    1    -    -   \n",
       "20      KY  ANDERSON                    Fentanyl    -    5    -    -    -   \n",
       "21      KY  ANDERSON                      Heroin    -    -   15   18   20   \n",
       "22      KY  ANDERSON                 Hydrocodone    7    6    1    2    -   \n",
       "23      KY  ANDERSON               Hydromorphone    -    -    1    -    -   \n",
       "24      KY  ANDERSON                   Methadone    2    -    -    1    -   \n",
       "25      KY  ANDERSON                  Methorphan    -    1    -    -    -   \n",
       "26      KY  ANDERSON                    Morphine    3    2    -    -    -   \n",
       "27      KY  ANDERSON                   Oxycodone   21   23    3    4    4   \n",
       "28      KY  ANDERSON                 Oxymorphone    -    1    -    -    -   \n",
       "29      KY  ANDERSON                    Tramadol    -    1    -    -    -   \n",
       "...    ...       ...                         ...  ...  ...  ...  ...  ...   \n",
       "6184    WV   WEBSTER                    Morphine    -    1    8    3    7   \n",
       "6185    WV   WEBSTER                   Oxycodone    -    3    -    4    2   \n",
       "6186    WV   WEBSTER                 Pentazocine    -    -    -    1    -   \n",
       "6187    WV    WETZEL               Buprenorphine    -    1    1    -    2   \n",
       "6188    WV    WETZEL                      Heroin    4   19    4    -   17   \n",
       "6189    WV    WETZEL                 Hydrocodone    4    1    2    -    2   \n",
       "6190    WV    WETZEL                    Morphine    -    -    1    1    1   \n",
       "6191    WV    WETZEL                   Oxycodone    2    6    3    -    8   \n",
       "6192    WV      WIRT                 Hydrocodone    1    -    -    -    -   \n",
       "6193    WV      WIRT                   Oxycodone    -    -    -    -    -   \n",
       "6194    WV      WOOD             Acetyl fentanyl    -    -    -    -    -   \n",
       "6195    WV      WOOD              Acryl fentanyl    -    -    -    -    -   \n",
       "6196    WV      WOOD               Buprenorphine    1    -    -    -    -   \n",
       "6197    WV      WOOD            Butyryl fentanyl    -    -    -    -    -   \n",
       "6198    WV      WOOD                     Codeine    -    -    -    1    -   \n",
       "6199    WV      WOOD          Dextropropoxyphene    -    1    -    -    -   \n",
       "6200    WV      WOOD                    Fentanyl    -    -    -    -   12   \n",
       "6201    WV      WOOD            Furanyl fentanyl    -    -    -    -    -   \n",
       "6202    WV      WOOD  Furanyl/3-Furanyl fentanyl    -    -    -    -    -   \n",
       "6203    WV      WOOD                      Heroin   60    4   27  127   90   \n",
       "6204    WV      WOOD                 Hydrocodone   15    4   17   21   29   \n",
       "6205    WV      WOOD               Hydromorphone    -    -    -    1    -   \n",
       "6206    WV      WOOD         Isobutyryl fentanyl    -    -    -    -    -   \n",
       "6207    WV      WOOD                   Methadone    2    2    1    1    2   \n",
       "6208    WV      WOOD                    Morphine    5    4    3    1    -   \n",
       "6209    WV      WOOD                   Oxycodone    6    4   24    7    7   \n",
       "6210    WV      WOOD                    Tramadol    -    -    -    -    1   \n",
       "6211    WV   WYOMING               Buprenorphine    -    1    1    1    -   \n",
       "6212    WV   WYOMING                 Hydrocodone    1    5    -    -    1   \n",
       "6213    WV   WYOMING                   Oxycodone    5    4   14   12    5   \n",
       "\n",
       "     2015 2016 2017  \n",
       "0       5    7   10  \n",
       "1       -    -    1  \n",
       "2       -    -    -  \n",
       "3       1    -    2  \n",
       "4       7   11    3  \n",
       "5       -    1    -  \n",
       "6       -    -    -  \n",
       "7       1    1    -  \n",
       "8       2    -    1  \n",
       "9       -    -    -  \n",
       "10      2    4    1  \n",
       "11      -    -    -  \n",
       "12      -    1    -  \n",
       "13      8   15   14  \n",
       "14      -    -    -  \n",
       "15      -    -    -  \n",
       "16      -    1    3  \n",
       "17      2    3    2  \n",
       "18      -    -    -  \n",
       "19      1    -    1  \n",
       "20      2    3    6  \n",
       "21     12   16   13  \n",
       "22      1    1    -  \n",
       "23      -    -    -  \n",
       "24      -    -    -  \n",
       "25      -    -    -  \n",
       "26      1    1    -  \n",
       "27      -    1    -  \n",
       "28      -    -    -  \n",
       "29      -    -    -  \n",
       "...   ...  ...  ...  \n",
       "6184    1    -    -  \n",
       "6185    2    1    3  \n",
       "6186    -    -    -  \n",
       "6187    1    1    -  \n",
       "6188   18    1    3  \n",
       "6189    3    -    -  \n",
       "6190    -    -    -  \n",
       "6191    6    -    -  \n",
       "6192    -    -    -  \n",
       "6193    -    1    -  \n",
       "6194   20    -    1  \n",
       "6195    -    -    9  \n",
       "6196    8    7    4  \n",
       "6197    -    -    3  \n",
       "6198    -    1    -  \n",
       "6199    -    -    -  \n",
       "6200    2   18   63  \n",
       "6201    -    -    2  \n",
       "6202    -    -    1  \n",
       "6203  125  137  144  \n",
       "6204   21   11    8  \n",
       "6205    -    -    -  \n",
       "6206    -    -    3  \n",
       "6207    1    1    -  \n",
       "6208    -    4    -  \n",
       "6209   11    7    1  \n",
       "6210    -    4    3  \n",
       "6211    -    -    1  \n",
       "6212    -    1    -  \n",
       "6213    -    -    -  \n",
       "\n",
       "[6214 rows x 11 columns]"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.pivot_table(df,index=['State','COUNTY','SubstanceName'],columns='YYYY',values='DrugReports',fill_value='-').reset_index().rename_axis(columns={'YYYY':''})\n",
    "#最后调用reset_index()和rename_axis()函数相当于把索引取消了"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#第二问：恢复好像没啥太大的用处 等用到时再学"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "练习第二题"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>日期</th>\n",
       "      <th>时间</th>\n",
       "      <th>维度</th>\n",
       "      <th>经度</th>\n",
       "      <th>方向</th>\n",
       "      <th>距离</th>\n",
       "      <th>深度</th>\n",
       "      <th>烈度</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2003.05.20</td>\n",
       "      <td>12:17:44 AM</td>\n",
       "      <td>39.04</td>\n",
       "      <td>40.38</td>\n",
       "      <td>west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2007.08.01</td>\n",
       "      <td>12:03:08 AM</td>\n",
       "      <td>40.79</td>\n",
       "      <td>30.09</td>\n",
       "      <td>west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>5.2</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1978.05.07</td>\n",
       "      <td>12:41:37 AM</td>\n",
       "      <td>38.58</td>\n",
       "      <td>27.61</td>\n",
       "      <td>south_west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1997.03.22</td>\n",
       "      <td>12:31:45 AM</td>\n",
       "      <td>39.47</td>\n",
       "      <td>36.44</td>\n",
       "      <td>south_west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2000.04.02</td>\n",
       "      <td>12:57:38 AM</td>\n",
       "      <td>40.80</td>\n",
       "      <td>30.24</td>\n",
       "      <td>south_west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>7.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2005.01.21</td>\n",
       "      <td>12:04:03 AM</td>\n",
       "      <td>37.11</td>\n",
       "      <td>27.75</td>\n",
       "      <td>south_west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>32.8</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2012.06.24</td>\n",
       "      <td>12:07:22 AM</td>\n",
       "      <td>38.75</td>\n",
       "      <td>43.61</td>\n",
       "      <td>south_west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>9.4</td>\n",
       "      <td>4.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1987.12.31</td>\n",
       "      <td>12:49:54 AM</td>\n",
       "      <td>39.43</td>\n",
       "      <td>27.98</td>\n",
       "      <td>south_east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2000.02.07</td>\n",
       "      <td>12:11:45 AM</td>\n",
       "      <td>40.05</td>\n",
       "      <td>34.07</td>\n",
       "      <td>south_east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2011.10.28</td>\n",
       "      <td>12:47:56 AM</td>\n",
       "      <td>38.76</td>\n",
       "      <td>43.54</td>\n",
       "      <td>south_east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>3.1</td>\n",
       "      <td>4.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2013.05.01</td>\n",
       "      <td>12:47:56 AM</td>\n",
       "      <td>37.31</td>\n",
       "      <td>37.11</td>\n",
       "      <td>south_east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>9.5</td>\n",
       "      <td>3.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>1989.04.27</td>\n",
       "      <td>12:45:19 AM</td>\n",
       "      <td>37.04</td>\n",
       "      <td>28.04</td>\n",
       "      <td>south</td>\n",
       "      <td>0.1</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>1999.11.26</td>\n",
       "      <td>12:42:20 AM</td>\n",
       "      <td>37.77</td>\n",
       "      <td>38.54</td>\n",
       "      <td>south</td>\n",
       "      <td>0.1</td>\n",
       "      <td>13.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>1999.12.20</td>\n",
       "      <td>12:41:56 AM</td>\n",
       "      <td>40.86</td>\n",
       "      <td>30.99</td>\n",
       "      <td>south</td>\n",
       "      <td>0.1</td>\n",
       "      <td>9.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>1984.02.02</td>\n",
       "      <td>12:10:29 AM</td>\n",
       "      <td>37.21</td>\n",
       "      <td>30.81</td>\n",
       "      <td>north_west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>15.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2011.05.22</td>\n",
       "      <td>12:49:49 AM</td>\n",
       "      <td>39.13</td>\n",
       "      <td>29.04</td>\n",
       "      <td>north_west</td>\n",
       "      <td>0.1</td>\n",
       "      <td>7.2</td>\n",
       "      <td>3.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>1971.05.20</td>\n",
       "      <td>12:08:46 AM</td>\n",
       "      <td>37.72</td>\n",
       "      <td>30.00</td>\n",
       "      <td>north_east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>1985.01.28</td>\n",
       "      <td>12:20:56 AM</td>\n",
       "      <td>38.85</td>\n",
       "      <td>29.06</td>\n",
       "      <td>north_east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>1997.05.31</td>\n",
       "      <td>12:59:03 AM</td>\n",
       "      <td>39.89</td>\n",
       "      <td>39.79</td>\n",
       "      <td>north_east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>26.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2005.07.24</td>\n",
       "      <td>12:36:10 AM</td>\n",
       "      <td>36.96</td>\n",
       "      <td>36.03</td>\n",
       "      <td>north_east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>22.0</td>\n",
       "      <td>4.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>1966.08.19</td>\n",
       "      <td>12:03:55 AM</td>\n",
       "      <td>39.21</td>\n",
       "      <td>41.40</td>\n",
       "      <td>east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>14.0</td>\n",
       "      <td>4.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>1990.07.05</td>\n",
       "      <td>12:43:04 AM</td>\n",
       "      <td>37.87</td>\n",
       "      <td>29.18</td>\n",
       "      <td>east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>1990.07.05</td>\n",
       "      <td>12:47:37 AM</td>\n",
       "      <td>37.87</td>\n",
       "      <td>29.18</td>\n",
       "      <td>east</td>\n",
       "      <td>0.1</td>\n",
       "      <td>6.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>1985.01.07</td>\n",
       "      <td>12:37:08 AM</td>\n",
       "      <td>39.24</td>\n",
       "      <td>27.80</td>\n",
       "      <td>west</td>\n",
       "      <td>0.2</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>1988.06.24</td>\n",
       "      <td>12:35:29 AM</td>\n",
       "      <td>39.51</td>\n",
       "      <td>26.19</td>\n",
       "      <td>west</td>\n",
       "      <td>0.2</td>\n",
       "      <td>14.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>1999.11.16</td>\n",
       "      <td>12:49:39 AM</td>\n",
       "      <td>40.70</td>\n",
       "      <td>31.63</td>\n",
       "      <td>west</td>\n",
       "      <td>0.2</td>\n",
       "      <td>4.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2006.06.09</td>\n",
       "      <td>12:53:05 AM</td>\n",
       "      <td>39.67</td>\n",
       "      <td>38.99</td>\n",
       "      <td>west</td>\n",
       "      <td>0.2</td>\n",
       "      <td>3.3</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>1966.08.19</td>\n",
       "      <td>12:41:18 AM</td>\n",
       "      <td>39.13</td>\n",
       "      <td>41.48</td>\n",
       "      <td>south_west</td>\n",
       "      <td>0.2</td>\n",
       "      <td>50.0</td>\n",
       "      <td>4.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>1966.12.30</td>\n",
       "      <td>12:57:09 AM</td>\n",
       "      <td>40.74</td>\n",
       "      <td>30.74</td>\n",
       "      <td>south_west</td>\n",
       "      <td>0.2</td>\n",
       "      <td>31.0</td>\n",
       "      <td>4.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>1967.05.22</td>\n",
       "      <td>12:46:02 AM</td>\n",
       "      <td>36.59</td>\n",
       "      <td>29.35</td>\n",
       "      <td>south_west</td>\n",
       "      <td>0.2</td>\n",
       "      <td>54.0</td>\n",
       "      <td>4.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10032</th>\n",
       "      <td>1930.05.08</td>\n",
       "      <td>12:35:27 AM</td>\n",
       "      <td>37.97</td>\n",
       "      <td>45.00</td>\n",
       "      <td>north_east</td>\n",
       "      <td>45.0</td>\n",
       "      <td>30.0</td>\n",
       "      <td>6.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10033</th>\n",
       "      <td>2007.03.23</td>\n",
       "      <td>12:30:54 AM</td>\n",
       "      <td>36.78</td>\n",
       "      <td>44.75</td>\n",
       "      <td>south_east</td>\n",
       "      <td>46.1</td>\n",
       "      <td>17.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10034</th>\n",
       "      <td>2011.01.23</td>\n",
       "      <td>12:51:23 AM</td>\n",
       "      <td>42.00</td>\n",
       "      <td>42.61</td>\n",
       "      <td>north_west</td>\n",
       "      <td>46.6</td>\n",
       "      <td>24.5</td>\n",
       "      <td>3.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10035</th>\n",
       "      <td>2009.09.13</td>\n",
       "      <td>12:01:04 AM</td>\n",
       "      <td>42.01</td>\n",
       "      <td>42.69</td>\n",
       "      <td>north</td>\n",
       "      <td>47.1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10036</th>\n",
       "      <td>1978.04.02</td>\n",
       "      <td>12:35:03 AM</td>\n",
       "      <td>42.40</td>\n",
       "      <td>26.60</td>\n",
       "      <td>north</td>\n",
       "      <td>48.5</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10037</th>\n",
       "      <td>1940.06.07</td>\n",
       "      <td>12:09:42 AM</td>\n",
       "      <td>42.00</td>\n",
       "      <td>43.00</td>\n",
       "      <td>north_east</td>\n",
       "      <td>49.0</td>\n",
       "      <td>15.0</td>\n",
       "      <td>4.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10038</th>\n",
       "      <td>2004.07.29</td>\n",
       "      <td>12:47:24 AM</td>\n",
       "      <td>36.61</td>\n",
       "      <td>44.64</td>\n",
       "      <td>south_east</td>\n",
       "      <td>53.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10039</th>\n",
       "      <td>1991.02.09</td>\n",
       "      <td>12:19:06 AM</td>\n",
       "      <td>42.50</td>\n",
       "      <td>26.76</td>\n",
       "      <td>north_west</td>\n",
       "      <td>55.1</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10040</th>\n",
       "      <td>1990.04.16</td>\n",
       "      <td>12:50:25 AM</td>\n",
       "      <td>42.41</td>\n",
       "      <td>26.30</td>\n",
       "      <td>north_west</td>\n",
       "      <td>57.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10041</th>\n",
       "      <td>1978.04.24</td>\n",
       "      <td>12:40:30 AM</td>\n",
       "      <td>42.40</td>\n",
       "      <td>26.20</td>\n",
       "      <td>north_west</td>\n",
       "      <td>60.6</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10042</th>\n",
       "      <td>1987.04.12</td>\n",
       "      <td>12:00:53 AM</td>\n",
       "      <td>42.51</td>\n",
       "      <td>26.57</td>\n",
       "      <td>north</td>\n",
       "      <td>60.9</td>\n",
       "      <td>8.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10043</th>\n",
       "      <td>1978.04.12</td>\n",
       "      <td>12:30:35 AM</td>\n",
       "      <td>42.50</td>\n",
       "      <td>26.40</td>\n",
       "      <td>north_west</td>\n",
       "      <td>62.8</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10044</th>\n",
       "      <td>2008.01.25</td>\n",
       "      <td>12:10:30 AM</td>\n",
       "      <td>42.40</td>\n",
       "      <td>26.11</td>\n",
       "      <td>north_west</td>\n",
       "      <td>65.1</td>\n",
       "      <td>7.7</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10045</th>\n",
       "      <td>1926.06.29</td>\n",
       "      <td>12:45:00 AM</td>\n",
       "      <td>42.60</td>\n",
       "      <td>26.70</td>\n",
       "      <td>north_west</td>\n",
       "      <td>67.3</td>\n",
       "      <td>6.0</td>\n",
       "      <td>4.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10046</th>\n",
       "      <td>2004.12.13</td>\n",
       "      <td>12:45:23 AM</td>\n",
       "      <td>36.49</td>\n",
       "      <td>44.71</td>\n",
       "      <td>south_east</td>\n",
       "      <td>67.6</td>\n",
       "      <td>19.0</td>\n",
       "      <td>3.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10047</th>\n",
       "      <td>2012.03.30</td>\n",
       "      <td>12:48:35 AM</td>\n",
       "      <td>42.55</td>\n",
       "      <td>26.31</td>\n",
       "      <td>north_west</td>\n",
       "      <td>70.1</td>\n",
       "      <td>10.9</td>\n",
       "      <td>3.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10048</th>\n",
       "      <td>1967.06.09</td>\n",
       "      <td>12:49:04 AM</td>\n",
       "      <td>42.60</td>\n",
       "      <td>26.50</td>\n",
       "      <td>north</td>\n",
       "      <td>71.6</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10049</th>\n",
       "      <td>1979.05.07</td>\n",
       "      <td>12:44:00 AM</td>\n",
       "      <td>42.48</td>\n",
       "      <td>26.10</td>\n",
       "      <td>north_west</td>\n",
       "      <td>72.7</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10050</th>\n",
       "      <td>1990.01.28</td>\n",
       "      <td>12:21:34 AM</td>\n",
       "      <td>42.46</td>\n",
       "      <td>26.06</td>\n",
       "      <td>north_west</td>\n",
       "      <td>73.0</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10051</th>\n",
       "      <td>2006.01.20</td>\n",
       "      <td>12:09:26 AM</td>\n",
       "      <td>42.63</td>\n",
       "      <td>26.55</td>\n",
       "      <td>north</td>\n",
       "      <td>74.3</td>\n",
       "      <td>10.0</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10052</th>\n",
       "      <td>2010.06.12</td>\n",
       "      <td>12:37:30 AM</td>\n",
       "      <td>42.22</td>\n",
       "      <td>43.11</td>\n",
       "      <td>north_east</td>\n",
       "      <td>74.6</td>\n",
       "      <td>11.6</td>\n",
       "      <td>3.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10053</th>\n",
       "      <td>2001.08.13</td>\n",
       "      <td>12:26:10 AM</td>\n",
       "      <td>42.65</td>\n",
       "      <td>26.49</td>\n",
       "      <td>north</td>\n",
       "      <td>77.2</td>\n",
       "      <td>10.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10054</th>\n",
       "      <td>2006.05.10</td>\n",
       "      <td>12:31:04 AM</td>\n",
       "      <td>42.48</td>\n",
       "      <td>25.99</td>\n",
       "      <td>north_west</td>\n",
       "      <td>78.6</td>\n",
       "      <td>17.8</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10055</th>\n",
       "      <td>2009.09.08</td>\n",
       "      <td>12:40:44 AM</td>\n",
       "      <td>42.28</td>\n",
       "      <td>43.02</td>\n",
       "      <td>north_east</td>\n",
       "      <td>79.1</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10056</th>\n",
       "      <td>2014.10.08</td>\n",
       "      <td>12:36:17 AM</td>\n",
       "      <td>42.29</td>\n",
       "      <td>42.96</td>\n",
       "      <td>north</td>\n",
       "      <td>80.3</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10057</th>\n",
       "      <td>2015.11.18</td>\n",
       "      <td>12:17:48 AM</td>\n",
       "      <td>42.31</td>\n",
       "      <td>42.94</td>\n",
       "      <td>north</td>\n",
       "      <td>81.6</td>\n",
       "      <td>5.0</td>\n",
       "      <td>3.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10058</th>\n",
       "      <td>1990.01.28</td>\n",
       "      <td>12:22:43 AM</td>\n",
       "      <td>42.70</td>\n",
       "      <td>26.20</td>\n",
       "      <td>north_west</td>\n",
       "      <td>89.5</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10059</th>\n",
       "      <td>2001.08.09</td>\n",
       "      <td>12:58:14 AM</td>\n",
       "      <td>42.77</td>\n",
       "      <td>26.47</td>\n",
       "      <td>north</td>\n",
       "      <td>90.6</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10060</th>\n",
       "      <td>1994.06.05</td>\n",
       "      <td>12:20:03 AM</td>\n",
       "      <td>42.41</td>\n",
       "      <td>43.06</td>\n",
       "      <td>north_east</td>\n",
       "      <td>94.3</td>\n",
       "      <td>33.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10061</th>\n",
       "      <td>2009.09.09</td>\n",
       "      <td>12:54:13 AM</td>\n",
       "      <td>42.42</td>\n",
       "      <td>43.03</td>\n",
       "      <td>north_east</td>\n",
       "      <td>95.4</td>\n",
       "      <td>5.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10062 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "               日期           时间     维度     经度          方向    距离    深度   烈度\n",
       "0      2003.05.20  12:17:44 AM  39.04  40.38        west   0.1  10.0  0.0\n",
       "1      2007.08.01  12:03:08 AM  40.79  30.09        west   0.1   5.2  4.0\n",
       "2      1978.05.07  12:41:37 AM  38.58  27.61  south_west   0.1   0.0  0.0\n",
       "3      1997.03.22  12:31:45 AM  39.47  36.44  south_west   0.1  10.0  0.0\n",
       "4      2000.04.02  12:57:38 AM  40.80  30.24  south_west   0.1   7.0  0.0\n",
       "5      2005.01.21  12:04:03 AM  37.11  27.75  south_west   0.1  32.8  0.0\n",
       "6      2012.06.24  12:07:22 AM  38.75  43.61  south_west   0.1   9.4  4.5\n",
       "7      1987.12.31  12:49:54 AM  39.43  27.98  south_east   0.1  26.0  0.0\n",
       "8      2000.02.07  12:11:45 AM  40.05  34.07  south_east   0.1   1.0  0.0\n",
       "9      2011.10.28  12:47:56 AM  38.76  43.54  south_east   0.1   3.1  4.2\n",
       "10     2013.05.01  12:47:56 AM  37.31  37.11  south_east   0.1   9.5  3.5\n",
       "11     1989.04.27  12:45:19 AM  37.04  28.04       south   0.1   9.0  0.0\n",
       "12     1999.11.26  12:42:20 AM  37.77  38.54       south   0.1  13.0  0.0\n",
       "13     1999.12.20  12:41:56 AM  40.86  30.99       south   0.1   9.0  0.0\n",
       "14     1984.02.02  12:10:29 AM  37.21  30.81  north_west   0.1  15.0  0.0\n",
       "15     2011.05.22  12:49:49 AM  39.13  29.04  north_west   0.1   7.2  3.9\n",
       "16     1971.05.20  12:08:46 AM  37.72  30.00  north_east   0.1   5.0  0.0\n",
       "17     1985.01.28  12:20:56 AM  38.85  29.06  north_east   0.1   4.0  0.0\n",
       "18     1997.05.31  12:59:03 AM  39.89  39.79  north_east   0.1  26.0  0.0\n",
       "19     2005.07.24  12:36:10 AM  36.96  36.03  north_east   0.1  22.0  4.1\n",
       "20     1966.08.19  12:03:55 AM  39.21  41.40        east   0.1  14.0  4.7\n",
       "21     1990.07.05  12:43:04 AM  37.87  29.18        east   0.1   5.0  0.0\n",
       "22     1990.07.05  12:47:37 AM  37.87  29.18        east   0.1   6.0  0.0\n",
       "23     1985.01.07  12:37:08 AM  39.24  27.80        west   0.2   5.0  0.0\n",
       "24     1988.06.24  12:35:29 AM  39.51  26.19        west   0.2  14.0  0.0\n",
       "25     1999.11.16  12:49:39 AM  40.70  31.63        west   0.2   4.0  0.0\n",
       "26     2006.06.09  12:53:05 AM  39.67  38.99        west   0.2   3.3  0.0\n",
       "27     1966.08.19  12:41:18 AM  39.13  41.48  south_west   0.2  50.0  4.7\n",
       "28     1966.12.30  12:57:09 AM  40.74  30.74  south_west   0.2  31.0  4.3\n",
       "29     1967.05.22  12:46:02 AM  36.59  29.35  south_west   0.2  54.0  4.6\n",
       "...           ...          ...    ...    ...         ...   ...   ...  ...\n",
       "10032  1930.05.08  12:35:27 AM  37.97  45.00  north_east  45.0  30.0  6.0\n",
       "10033  2007.03.23  12:30:54 AM  36.78  44.75  south_east  46.1  17.7  0.0\n",
       "10034  2011.01.23  12:51:23 AM  42.00  42.61  north_west  46.6  24.5  3.7\n",
       "10035  2009.09.13  12:01:04 AM  42.01  42.69       north  47.1   5.0  0.0\n",
       "10036  1978.04.02  12:35:03 AM  42.40  26.60       north  48.5   0.0  0.0\n",
       "10037  1940.06.07  12:09:42 AM  42.00  43.00  north_east  49.0  15.0  4.6\n",
       "10038  2004.07.29  12:47:24 AM  36.61  44.64  south_east  53.0  10.0  0.0\n",
       "10039  1991.02.09  12:19:06 AM  42.50  26.76  north_west  55.1   1.0  3.5\n",
       "10040  1990.04.16  12:50:25 AM  42.41  26.30  north_west  57.0  10.0  0.0\n",
       "10041  1978.04.24  12:40:30 AM  42.40  26.20  north_west  60.6  10.0  0.0\n",
       "10042  1987.04.12  12:00:53 AM  42.51  26.57       north  60.9   8.0  0.0\n",
       "10043  1978.04.12  12:30:35 AM  42.50  26.40  north_west  62.8  10.0  0.0\n",
       "10044  2008.01.25  12:10:30 AM  42.40  26.11  north_west  65.1   7.7  0.0\n",
       "10045  1926.06.29  12:45:00 AM  42.60  26.70  north_west  67.3   6.0  4.9\n",
       "10046  2004.12.13  12:45:23 AM  36.49  44.71  south_east  67.6  19.0  3.5\n",
       "10047  2012.03.30  12:48:35 AM  42.55  26.31  north_west  70.1  10.9  3.9\n",
       "10048  1967.06.09  12:49:04 AM  42.60  26.50       north  71.6   5.0  0.0\n",
       "10049  1979.05.07  12:44:00 AM  42.48  26.10  north_west  72.7  10.0  0.0\n",
       "10050  1990.01.28  12:21:34 AM  42.46  26.06  north_west  73.0   5.0  0.0\n",
       "10051  2006.01.20  12:09:26 AM  42.63  26.55       north  74.3  10.0  4.0\n",
       "10052  2010.06.12  12:37:30 AM  42.22  43.11  north_east  74.6  11.6  3.6\n",
       "10053  2001.08.13  12:26:10 AM  42.65  26.49       north  77.2  10.0  0.0\n",
       "10054  2006.05.10  12:31:04 AM  42.48  25.99  north_west  78.6  17.8  0.0\n",
       "10055  2009.09.08  12:40:44 AM  42.28  43.02  north_east  79.1   5.0  0.0\n",
       "10056  2014.10.08  12:36:17 AM  42.29  42.96       north  80.3   5.0  3.9\n",
       "10057  2015.11.18  12:17:48 AM  42.31  42.94       north  81.6   5.0  3.8\n",
       "10058  1990.01.28  12:22:43 AM  42.70  26.20  north_west  89.5   2.0  0.0\n",
       "10059  2001.08.09  12:58:14 AM  42.77  26.47       north  90.6   5.0  0.0\n",
       "10060  1994.06.05  12:20:03 AM  42.41  43.06  north_east  94.3  33.0  0.0\n",
       "10061  2009.09.09  12:54:13 AM  42.42  43.03  north_east  95.4   5.0  0.0\n",
       "\n",
       "[10062 rows x 8 columns]"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv('data/Earthquake.csv')\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe thead tr:last-of-type th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th colspan=\"8\" halign=\"left\">深度</th>\n",
       "      <th colspan=\"5\" halign=\"left\">烈度</th>\n",
       "      <th colspan=\"8\" halign=\"left\">距离</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>方向</th>\n",
       "      <th>east</th>\n",
       "      <th>north</th>\n",
       "      <th>north_east</th>\n",
       "      <th>north_west</th>\n",
       "      <th>south</th>\n",
       "      <th>south_east</th>\n",
       "      <th>south_west</th>\n",
       "      <th>west</th>\n",
       "      <th>east</th>\n",
       "      <th>north</th>\n",
       "      <th>...</th>\n",
       "      <th>south_west</th>\n",
       "      <th>west</th>\n",
       "      <th>east</th>\n",
       "      <th>north</th>\n",
       "      <th>north_east</th>\n",
       "      <th>north_west</th>\n",
       "      <th>south</th>\n",
       "      <th>south_east</th>\n",
       "      <th>south_west</th>\n",
       "      <th>west</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>日期</th>\n",
       "      <th>时间</th>\n",
       "      <th>维度</th>\n",
       "      <th>经度</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1912.08.09</th>\n",
       "      <th>12:29:00 AM</th>\n",
       "      <th>40.60</th>\n",
       "      <th>27.20</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>16</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1912.08.10</th>\n",
       "      <th>12:23:00 AM</th>\n",
       "      <th>40.60</th>\n",
       "      <th>27.10</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:30:00 AM</th>\n",
       "      <th>40.60</th>\n",
       "      <th>27.10</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>5.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1912.08.11</th>\n",
       "      <th>12:19:04 AM</th>\n",
       "      <th>40.60</th>\n",
       "      <th>27.20</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>30</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:20:00 AM</th>\n",
       "      <th>40.60</th>\n",
       "      <th>27.10</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1912.09.16</th>\n",
       "      <th>12:04:02 AM</th>\n",
       "      <th>40.10</th>\n",
       "      <th>26.80</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>30</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1913.01.27</th>\n",
       "      <th>12:38:36 AM</th>\n",
       "      <th>38.38</th>\n",
       "      <th>42.23</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>10</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.05.28</th>\n",
       "      <th>12:27:30 AM</th>\n",
       "      <th>39.84</th>\n",
       "      <th>35.80</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>10</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">1914.10.03</th>\n",
       "      <th>12:07:02 AM</th>\n",
       "      <th>37.70</th>\n",
       "      <th>30.40</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>14</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:23:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"8\" valign=\"top\">1914.10.04</th>\n",
       "      <th>12:07:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:10:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:20:01 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:22:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:28:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:48:58 AM</th>\n",
       "      <th>38.01</th>\n",
       "      <th>38.24</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:50:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.9</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:50:01 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.10.05</th>\n",
       "      <th>12:09:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.10.06</th>\n",
       "      <th>12:30:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.10.08</th>\n",
       "      <th>12:13:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.10.10</th>\n",
       "      <th>12:13:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.10.11</th>\n",
       "      <th>12:45:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>5.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.10.13</th>\n",
       "      <th>12:38:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.10.17</th>\n",
       "      <th>12:13:00 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>30.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1914.12.03</th>\n",
       "      <th>12:39:03 AM</th>\n",
       "      <th>41.00</th>\n",
       "      <th>43.90</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>21</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>23.8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1915.02.14</th>\n",
       "      <th>12:20:01 AM</th>\n",
       "      <th>38.80</th>\n",
       "      <th>42.50</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>30</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>5.4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1915.02.28</th>\n",
       "      <th>12:47:02 AM</th>\n",
       "      <th>37.70</th>\n",
       "      <th>43.10</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>30</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>9</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1915.05.19</th>\n",
       "      <th>12:48:02 AM</th>\n",
       "      <th>37.62</th>\n",
       "      <th>39.47</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>10</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1915.09.23</th>\n",
       "      <th>12:20:01 AM</th>\n",
       "      <th>40.00</th>\n",
       "      <th>43.00</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.8</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.06.04</th>\n",
       "      <th>12:04:54 AM</th>\n",
       "      <th>38.35</th>\n",
       "      <th>26.61</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>9.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.06.10</th>\n",
       "      <th>12:51:46 AM</th>\n",
       "      <th>40.06</th>\n",
       "      <th>35.70</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.06.12</th>\n",
       "      <th>12:38:53 AM</th>\n",
       "      <th>38.58</th>\n",
       "      <th>27.03</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>16.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>3.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.6</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.06.16</th>\n",
       "      <th>12:46:18 AM</th>\n",
       "      <th>38.27</th>\n",
       "      <th>26.44</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>7.8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.8</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.06.22</th>\n",
       "      <th>12:56:34 AM</th>\n",
       "      <th>38.66</th>\n",
       "      <th>27.53</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>11.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.06.28</th>\n",
       "      <th>12:59:57 AM</th>\n",
       "      <th>36.93</th>\n",
       "      <th>29.63</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>3.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.07</th>\n",
       "      <th>12:25:16 AM</th>\n",
       "      <th>40.48</th>\n",
       "      <th>34.44</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>3.4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2017.07.08</th>\n",
       "      <th>12:27:56 AM</th>\n",
       "      <th>38.99</th>\n",
       "      <th>27.73</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>13.8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2.8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:48:23 AM</th>\n",
       "      <th>38.66</th>\n",
       "      <th>43.20</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.09</th>\n",
       "      <th>12:08:15 AM</th>\n",
       "      <th>38.69</th>\n",
       "      <th>38.09</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>3.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.13</th>\n",
       "      <th>12:19:05 AM</th>\n",
       "      <th>40.54</th>\n",
       "      <th>35.40</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.15</th>\n",
       "      <th>12:00:31 AM</th>\n",
       "      <th>38.17</th>\n",
       "      <th>43.23</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.16</th>\n",
       "      <th>12:12:06 AM</th>\n",
       "      <th>39.93</th>\n",
       "      <th>40.75</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>3.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.9</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.19</th>\n",
       "      <th>12:42:51 AM</th>\n",
       "      <th>38.80</th>\n",
       "      <th>27.81</th>\n",
       "      <td>10.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.1</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2017.07.20</th>\n",
       "      <th>12:00:45 AM</th>\n",
       "      <th>36.99</th>\n",
       "      <th>27.41</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>9.8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>3.8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.8</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:23:51 AM</th>\n",
       "      <th>36.96</th>\n",
       "      <th>27.31</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>12.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">2017.07.21</th>\n",
       "      <th>12:09:46 AM</th>\n",
       "      <th>36.95</th>\n",
       "      <th>27.25</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.9</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.5</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:16:40 AM</th>\n",
       "      <th>36.97</th>\n",
       "      <th>27.33</th>\n",
       "      <td>8.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.1</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:25:35 AM</th>\n",
       "      <th>36.98</th>\n",
       "      <th>27.42</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:42:36 AM</th>\n",
       "      <th>36.94</th>\n",
       "      <th>27.30</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:50:30 AM</th>\n",
       "      <th>36.98</th>\n",
       "      <th>27.38</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>11.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:55:25 AM</th>\n",
       "      <th>36.99</th>\n",
       "      <th>27.33</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>12.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2017.07.22</th>\n",
       "      <th>12:09:20 AM</th>\n",
       "      <th>36.94</th>\n",
       "      <th>27.25</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>8</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>4.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.9</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:12:32 AM</th>\n",
       "      <th>40.02</th>\n",
       "      <th>27.14</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>13.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.25</th>\n",
       "      <th>12:13:24 AM</th>\n",
       "      <th>38.00</th>\n",
       "      <th>38.42</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>3.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.26</th>\n",
       "      <th>12:50:05 AM</th>\n",
       "      <th>40.76</th>\n",
       "      <th>32.87</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">2017.07.29</th>\n",
       "      <th>12:24:11 AM</th>\n",
       "      <th>37.12</th>\n",
       "      <th>28.59</th>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.9</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12:33:23 AM</th>\n",
       "      <th>37.11</th>\n",
       "      <th>27.73</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.30</th>\n",
       "      <th>12:21:33 AM</th>\n",
       "      <th>37.39</th>\n",
       "      <th>31.37</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>3.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2017.07.31</th>\n",
       "      <th>12:11:31 AM</th>\n",
       "      <th>37.42</th>\n",
       "      <th>31.37</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>...</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>10062 rows × 24 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                      深度                                    \\\n",
       "方向                                  east north north_east north_west south   \n",
       "日期         时间          维度    经度                                              \n",
       "1912.08.09 12:29:00 AM 40.60 27.20     -     -          -          -     -   \n",
       "1912.08.10 12:23:00 AM 40.60 27.10     -     -          -          -     -   \n",
       "           12:30:00 AM 40.60 27.10     -     -          -          -     -   \n",
       "1912.08.11 12:19:04 AM 40.60 27.20     -     -          -          -     -   \n",
       "           12:20:00 AM 40.60 27.10     -     -          -          -     -   \n",
       "1912.09.16 12:04:02 AM 40.10 26.80     -     -         30          -     -   \n",
       "1913.01.27 12:38:36 AM 38.38 42.23     -     -          -         10     -   \n",
       "1914.05.28 12:27:30 AM 39.84 35.80     -     -         10          -     -   \n",
       "1914.10.03 12:07:02 AM 37.70 30.40     -     -          -          -    14   \n",
       "           12:23:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.10.04 12:07:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "           12:10:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "           12:20:01 AM 38.00 30.00     -     -          -          -     -   \n",
       "           12:22:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "           12:28:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "           12:48:58 AM 38.01 38.24     -     -          -          -    15   \n",
       "           12:50:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "           12:50:01 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.10.05 12:09:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.10.06 12:30:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.10.08 12:13:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.10.10 12:13:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.10.11 12:45:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.10.13 12:38:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.10.17 12:13:00 AM 38.00 30.00     -     -          -          -     -   \n",
       "1914.12.03 12:39:03 AM 41.00 43.90     -     -         21          -     -   \n",
       "1915.02.14 12:20:01 AM 38.80 42.50     -     -          -          -     -   \n",
       "1915.02.28 12:47:02 AM 37.70 43.10     -     -          -         30     -   \n",
       "1915.05.19 12:48:02 AM 37.62 39.47     -     -          -          -     -   \n",
       "1915.09.23 12:20:01 AM 40.00 43.00     -     -          -          -     -   \n",
       "...                                  ...   ...        ...        ...   ...   \n",
       "2017.06.04 12:04:54 AM 38.35 26.61     -     -        9.6          -     -   \n",
       "2017.06.10 12:51:46 AM 40.06 35.70     -     -          -          -     -   \n",
       "2017.06.12 12:38:53 AM 38.58 27.03     -     -          -          -     -   \n",
       "2017.06.16 12:46:18 AM 38.27 26.44     -     -          -          -     -   \n",
       "2017.06.22 12:56:34 AM 38.66 27.53     -     -          -          -     -   \n",
       "2017.06.28 12:59:57 AM 36.93 29.63     -     -          -          -     -   \n",
       "2017.07.07 12:25:16 AM 40.48 34.44     -     -          -          -     -   \n",
       "2017.07.08 12:27:56 AM 38.99 27.73     -     -          -          -     -   \n",
       "           12:48:23 AM 38.66 43.20     -     -          -          -     -   \n",
       "2017.07.09 12:08:15 AM 38.69 38.09     -     -          -          -     -   \n",
       "2017.07.13 12:19:05 AM 40.54 35.40     -     -          -        3.6     -   \n",
       "2017.07.15 12:00:31 AM 38.17 43.23     -     -        2.1          -     -   \n",
       "2017.07.16 12:12:06 AM 39.93 40.75     -     -          -          -     -   \n",
       "2017.07.19 12:42:51 AM 38.80 27.81  10.7     -          -          -     -   \n",
       "2017.07.20 12:00:45 AM 36.99 27.41     -     -          -          -     -   \n",
       "           12:23:51 AM 36.96 27.31     -     -          -          -     -   \n",
       "2017.07.21 12:09:46 AM 36.95 27.25     -     -          -          -     -   \n",
       "           12:16:40 AM 36.97 27.33   8.1     -          -          -     -   \n",
       "           12:25:35 AM 36.98 27.42     -     -          -          -   6.5   \n",
       "           12:42:36 AM 36.94 27.30     -     -          -          -     -   \n",
       "           12:50:30 AM 36.98 27.38     -     -          -          -     -   \n",
       "           12:55:25 AM 36.99 27.33     -     -       12.2          -     -   \n",
       "2017.07.22 12:09:20 AM 36.94 27.25     -     -          -          -     -   \n",
       "           12:12:32 AM 40.02 27.14     -     -       13.2          -     -   \n",
       "2017.07.25 12:13:24 AM 38.00 38.42     -     -          -          -     -   \n",
       "2017.07.26 12:50:05 AM 40.76 32.87     -     -          -          -     -   \n",
       "2017.07.29 12:24:11 AM 37.12 28.59     -     5          -          -     -   \n",
       "           12:33:23 AM 37.11 27.73     -     -        6.5          -     -   \n",
       "2017.07.30 12:21:33 AM 37.39 31.37     -     -          -          -     -   \n",
       "2017.07.31 12:11:31 AM 37.42 31.37     -     -          -        5.1     -   \n",
       "\n",
       "                                                                烈度        ...  \\\n",
       "方向                                 south_east south_west west east north  ...   \n",
       "日期         时间          维度    经度                                           ...   \n",
       "1912.08.09 12:29:00 AM 40.60 27.20         16          -    -    -     -  ...   \n",
       "1912.08.10 12:23:00 AM 40.60 27.10          -         15    -    -     -  ...   \n",
       "           12:30:00 AM 40.60 27.10          -         15    -    -     -  ...   \n",
       "1912.08.11 12:19:04 AM 40.60 27.20         30          -    -    -     -  ...   \n",
       "           12:20:00 AM 40.60 27.10          -         15    -    -     -  ...   \n",
       "1912.09.16 12:04:02 AM 40.10 26.80          -          -    -    -     -  ...   \n",
       "1913.01.27 12:38:36 AM 38.38 42.23          -          -    -    -     -  ...   \n",
       "1914.05.28 12:27:30 AM 39.84 35.80          -          -    -    -     -  ...   \n",
       "1914.10.03 12:07:02 AM 37.70 30.40          -          -    -    -     -  ...   \n",
       "           12:23:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.10.04 12:07:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "           12:10:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "           12:20:01 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "           12:22:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "           12:28:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "           12:48:58 AM 38.01 38.24          -          -    -    -     -  ...   \n",
       "           12:50:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "           12:50:01 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.10.05 12:09:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.10.06 12:30:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.10.08 12:13:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.10.10 12:13:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.10.11 12:45:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.10.13 12:38:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.10.17 12:13:00 AM 38.00 30.00          -         15    -    -     -  ...   \n",
       "1914.12.03 12:39:03 AM 41.00 43.90          -          -    -    -     -  ...   \n",
       "1915.02.14 12:20:01 AM 38.80 42.50          -         30    -    -     -  ...   \n",
       "1915.02.28 12:47:02 AM 37.70 43.10          -          -    -    -     -  ...   \n",
       "1915.05.19 12:48:02 AM 37.62 39.47         10          -    -    -     -  ...   \n",
       "1915.09.23 12:20:01 AM 40.00 43.00          -         15    -    -     -  ...   \n",
       "...                                       ...        ...  ...  ...   ...  ...   \n",
       "2017.06.04 12:04:54 AM 38.35 26.61          -          -    -    -     -  ...   \n",
       "2017.06.10 12:51:46 AM 40.06 35.70        4.7          -    -    -     -  ...   \n",
       "2017.06.12 12:38:53 AM 38.58 27.03          -       16.3    -    -     -  ...   \n",
       "2017.06.16 12:46:18 AM 38.27 26.44          -        7.8    -    -     -  ...   \n",
       "2017.06.22 12:56:34 AM 38.66 27.53       11.3          -    -    -     -  ...   \n",
       "2017.06.28 12:59:57 AM 36.93 29.63          -          5    -    -     -  ...   \n",
       "2017.07.07 12:25:16 AM 40.48 34.44          -          -    5    -     -  ...   \n",
       "2017.07.08 12:27:56 AM 38.99 27.73       13.8          -    -    -     -  ...   \n",
       "           12:48:23 AM 38.66 43.20          5          -    -    -     -  ...   \n",
       "2017.07.09 12:08:15 AM 38.69 38.09          -          -    5    -     -  ...   \n",
       "2017.07.13 12:19:05 AM 40.54 35.40          -          -    -    -     -  ...   \n",
       "2017.07.15 12:00:31 AM 38.17 43.23          -          -    -    -     -  ...   \n",
       "2017.07.16 12:12:06 AM 39.93 40.75          -          5    -    -     -  ...   \n",
       "2017.07.19 12:42:51 AM 38.80 27.81          -          -    -  4.1     -  ...   \n",
       "2017.07.20 12:00:45 AM 36.99 27.41          -        9.8    -    -     -  ...   \n",
       "           12:23:51 AM 36.96 27.31       12.2          -    -    -     -  ...   \n",
       "2017.07.21 12:09:46 AM 36.95 27.25          -        6.7    -    -     -  ...   \n",
       "           12:16:40 AM 36.97 27.33          -          -    -  4.1     -  ...   \n",
       "           12:25:35 AM 36.98 27.42          -          -    -    -     -  ...   \n",
       "           12:42:36 AM 36.94 27.30        4.5          -    -    -     -  ...   \n",
       "           12:50:30 AM 36.98 27.38       11.6          -    -    -     -  ...   \n",
       "           12:55:25 AM 36.99 27.33          -          -    -    -     -  ...   \n",
       "2017.07.22 12:09:20 AM 36.94 27.25          -          8    -    -     -  ...   \n",
       "           12:12:32 AM 40.02 27.14          -          -    -    -     -  ...   \n",
       "2017.07.25 12:13:24 AM 38.00 38.42          -          -  1.4    -     -  ...   \n",
       "2017.07.26 12:50:05 AM 40.76 32.87          5          -    -    -     -  ...   \n",
       "2017.07.29 12:24:11 AM 37.12 28.59          -          -    -    -   3.9  ...   \n",
       "           12:33:23 AM 37.11 27.73          -          -    -    -     -  ...   \n",
       "2017.07.30 12:21:33 AM 37.39 31.37          -          5    -    -     -  ...   \n",
       "2017.07.31 12:11:31 AM 37.42 31.37          -          -    -    -     -  ...   \n",
       "\n",
       "                                                     距离                   \\\n",
       "方向                                 south_west west east north north_east   \n",
       "日期         时间          维度    经度                                            \n",
       "1912.08.09 12:29:00 AM 40.60 27.20          -    -    -     -          -   \n",
       "1912.08.10 12:23:00 AM 40.60 27.10          6    -    -     -          -   \n",
       "           12:30:00 AM 40.60 27.10        5.2    -    -     -          -   \n",
       "1912.08.11 12:19:04 AM 40.60 27.20          -    -    -     -          -   \n",
       "           12:20:00 AM 40.60 27.10        4.5    -    -     -          -   \n",
       "1912.09.16 12:04:02 AM 40.10 26.80          -    -    -     -        4.3   \n",
       "1913.01.27 12:38:36 AM 38.38 42.23          -    -    -     -          -   \n",
       "1914.05.28 12:27:30 AM 39.84 35.80          -    -    -     -          2   \n",
       "1914.10.03 12:07:02 AM 37.70 30.40          -    -    -     -          -   \n",
       "           12:23:00 AM 38.00 30.00        4.7    -    -     -          -   \n",
       "1914.10.04 12:07:00 AM 38.00 30.00        4.7    -    -     -          -   \n",
       "           12:10:00 AM 38.00 30.00        4.7    -    -     -          -   \n",
       "           12:20:01 AM 38.00 30.00          0    -    -     -          -   \n",
       "           12:22:00 AM 38.00 30.00        4.7    -    -     -          -   \n",
       "           12:28:00 AM 38.00 30.00        4.6    -    -     -          -   \n",
       "           12:48:58 AM 38.01 38.24          -    -    -     -          -   \n",
       "           12:50:00 AM 38.00 30.00        4.9    -    -     -          -   \n",
       "           12:50:01 AM 38.00 30.00          0    -    -     -          -   \n",
       "1914.10.05 12:09:00 AM 38.00 30.00        4.6    -    -     -          -   \n",
       "1914.10.06 12:30:00 AM 38.00 30.00        4.6    -    -     -          -   \n",
       "1914.10.08 12:13:00 AM 38.00 30.00        4.8    -    -     -          -   \n",
       "1914.10.10 12:13:00 AM 38.00 30.00        4.6    -    -     -          -   \n",
       "1914.10.11 12:45:00 AM 38.00 30.00        5.1    -    -     -          -   \n",
       "1914.10.13 12:38:00 AM 38.00 30.00        4.6    -    -     -          -   \n",
       "1914.10.17 12:13:00 AM 38.00 30.00        4.8    -    -     -          -   \n",
       "1914.12.03 12:39:03 AM 41.00 43.90          -    -    -     -       23.8   \n",
       "1915.02.14 12:20:01 AM 38.80 42.50        5.4    -    -     -          -   \n",
       "1915.02.28 12:47:02 AM 37.70 43.10          -    -    -     -          -   \n",
       "1915.05.19 12:48:02 AM 37.62 39.47          -    -    -     -          -   \n",
       "1915.09.23 12:20:01 AM 40.00 43.00          0    -    -     -          -   \n",
       "...                                       ...  ...  ...   ...        ...   \n",
       "2017.06.04 12:04:54 AM 38.35 26.61          -    -    -     -        4.6   \n",
       "2017.06.10 12:51:46 AM 40.06 35.70          -    -    -     -          -   \n",
       "2017.06.12 12:38:53 AM 38.58 27.03        3.3    -    -     -          -   \n",
       "2017.06.16 12:46:18 AM 38.27 26.44          4    -    -     -          -   \n",
       "2017.06.22 12:56:34 AM 38.66 27.53          -    -    -     -          -   \n",
       "2017.06.28 12:59:57 AM 36.93 29.63        3.7    -    -     -          -   \n",
       "2017.07.07 12:25:16 AM 40.48 34.44          -  3.4    -     -          -   \n",
       "2017.07.08 12:27:56 AM 38.99 27.73          -    -    -     -          -   \n",
       "           12:48:23 AM 38.66 43.20          -    -    -     -          -   \n",
       "2017.07.09 12:08:15 AM 38.69 38.09          -  3.6    -     -          -   \n",
       "2017.07.13 12:19:05 AM 40.54 35.40          -    -    -     -          -   \n",
       "2017.07.15 12:00:31 AM 38.17 43.23          -    -    -     -        0.2   \n",
       "2017.07.16 12:12:06 AM 39.93 40.75        3.3    -    -     -          -   \n",
       "2017.07.19 12:42:51 AM 38.80 27.81          -    -  1.3     -          -   \n",
       "2017.07.20 12:00:45 AM 36.99 27.41        3.8    -    -     -          -   \n",
       "           12:23:51 AM 36.96 27.31          -    -    -     -          -   \n",
       "2017.07.21 12:09:46 AM 36.95 27.25        4.9    -    -     -          -   \n",
       "           12:16:40 AM 36.97 27.33          -    -  3.4     -          -   \n",
       "           12:25:35 AM 36.98 27.42          -    -    -     -          -   \n",
       "           12:42:36 AM 36.94 27.30          -    -    -     -          -   \n",
       "           12:50:30 AM 36.98 27.38          -    -    -     -          -   \n",
       "           12:55:25 AM 36.99 27.33          -    -    -     -          4   \n",
       "2017.07.22 12:09:20 AM 36.94 27.25        4.5    -    -     -          -   \n",
       "           12:12:32 AM 40.02 27.14          -    -    -     -          1   \n",
       "2017.07.25 12:13:24 AM 38.00 38.42          -  3.6    -     -          -   \n",
       "2017.07.26 12:50:05 AM 40.76 32.87          -    -    -     -          -   \n",
       "2017.07.29 12:24:11 AM 37.12 28.59          -    -    -   0.5          -   \n",
       "           12:33:23 AM 37.11 27.73          -    -    -     -        1.2   \n",
       "2017.07.30 12:21:33 AM 37.39 31.37        3.5    -    -     -          -   \n",
       "2017.07.31 12:11:31 AM 37.42 31.37          -    -    -     -          -   \n",
       "\n",
       "                                                                                \n",
       "方向                                 north_west south south_east south_west west  \n",
       "日期         时间          维度    经度                                                 \n",
       "1912.08.09 12:29:00 AM 40.60 27.20          -     -        4.3          -    -  \n",
       "1912.08.10 12:23:00 AM 40.60 27.10          -     -          -          2    -  \n",
       "           12:30:00 AM 40.60 27.10          -     -          -          2    -  \n",
       "1912.08.11 12:19:04 AM 40.60 27.20          -     -        4.3          -    -  \n",
       "           12:20:00 AM 40.60 27.10          -     -          -          2    -  \n",
       "1912.09.16 12:04:02 AM 40.10 26.80          -     -          -          -    -  \n",
       "1913.01.27 12:38:36 AM 38.38 42.23        0.5     -          -          -    -  \n",
       "1914.05.28 12:27:30 AM 39.84 35.80          -     -          -          -    -  \n",
       "1914.10.03 12:07:02 AM 37.70 30.40          -   0.7          -          -    -  \n",
       "           12:23:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.10.04 12:07:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "           12:10:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "           12:20:01 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "           12:22:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "           12:28:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "           12:48:58 AM 38.01 38.24          -   2.6          -          -    -  \n",
       "           12:50:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "           12:50:01 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.10.05 12:09:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.10.06 12:30:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.10.08 12:13:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.10.10 12:13:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.10.11 12:45:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.10.13 12:38:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.10.17 12:13:00 AM 38.00 30.00          -     -          -        0.7    -  \n",
       "1914.12.03 12:39:03 AM 41.00 43.90          -     -          -          -    -  \n",
       "1915.02.14 12:20:01 AM 38.80 42.50          -     -          -        3.7    -  \n",
       "1915.02.28 12:47:02 AM 37.70 43.10          9     -          -          -    -  \n",
       "1915.05.19 12:48:02 AM 37.62 39.47          -     -        3.5          -    -  \n",
       "1915.09.23 12:20:01 AM 40.00 43.00          -     -          -        5.8    -  \n",
       "...                                       ...   ...        ...        ...  ...  \n",
       "2017.06.04 12:04:54 AM 38.35 26.61          -     -          -          -    -  \n",
       "2017.06.10 12:51:46 AM 40.06 35.70          -     -        4.1          -    -  \n",
       "2017.06.12 12:38:53 AM 38.58 27.03          -     -          -        4.6    -  \n",
       "2017.06.16 12:46:18 AM 38.27 26.44          -     -          -        3.8    -  \n",
       "2017.06.22 12:56:34 AM 38.66 27.53          -     -        1.7          -    -  \n",
       "2017.06.28 12:59:57 AM 36.93 29.63          -     -          -        5.7    -  \n",
       "2017.07.07 12:25:16 AM 40.48 34.44          -     -          -          -  1.2  \n",
       "2017.07.08 12:27:56 AM 38.99 27.73          -     -        2.8          -    -  \n",
       "           12:48:23 AM 38.66 43.20          -     -        2.1          -    -  \n",
       "2017.07.09 12:08:15 AM 38.69 38.09          -     -          -          -  2.7  \n",
       "2017.07.13 12:19:05 AM 40.54 35.40        3.5     -          -          -    -  \n",
       "2017.07.15 12:00:31 AM 38.17 43.23          -     -          -          -    -  \n",
       "2017.07.16 12:12:06 AM 39.93 40.75          -     -          -        1.9    -  \n",
       "2017.07.19 12:42:51 AM 38.80 27.81          -     -          -          -    -  \n",
       "2017.07.20 12:00:45 AM 36.99 27.41          -     -          -        4.8    -  \n",
       "           12:23:51 AM 36.96 27.31          -     -        2.2          -    -  \n",
       "2017.07.21 12:09:46 AM 36.95 27.25          -     -          -        4.5    -  \n",
       "           12:16:40 AM 36.97 27.33          -     -          -          -    -  \n",
       "           12:25:35 AM 36.98 27.42          -   6.5          -          -    -  \n",
       "           12:42:36 AM 36.94 27.30          -     -        3.6          -    -  \n",
       "           12:50:30 AM 36.98 27.38          -     -        5.2          -    -  \n",
       "           12:55:25 AM 36.99 27.33          -     -          -          -    -  \n",
       "2017.07.22 12:09:20 AM 36.94 27.25          -     -          -        4.9    -  \n",
       "           12:12:32 AM 40.02 27.14          -     -          -          -    -  \n",
       "2017.07.25 12:13:24 AM 38.00 38.42          -     -          -          -  1.8  \n",
       "2017.07.26 12:50:05 AM 40.76 32.87          -     -        2.1          -    -  \n",
       "2017.07.29 12:24:11 AM 37.12 28.59          -     -          -          -    -  \n",
       "           12:33:23 AM 37.11 27.73          -     -          -          -    -  \n",
       "2017.07.30 12:21:33 AM 37.39 31.37          -     -          -          6    -  \n",
       "2017.07.31 12:11:31 AM 37.42 31.37        6.2     -          -          -    -  \n",
       "\n",
       "[10062 rows x 24 columns]"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#第一问\n",
    "pd.pivot_table(df,index=['日期','时间','维度','经度'],columns=['方向'],values = ['烈度','深度','距离'],fill_value='-')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>方向</th>\n",
       "      <th>east</th>\n",
       "      <th>north</th>\n",
       "      <th>north_east</th>\n",
       "      <th>north_west</th>\n",
       "      <th>south</th>\n",
       "      <th>south_east</th>\n",
       "      <th>south_west</th>\n",
       "      <th>west</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>日期</th>\n",
       "      <th>时间</th>\n",
       "      <th>维度</th>\n",
       "      <th>经度</th>\n",
       "      <th>地震参数</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">1912.08.09</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:29:00 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">40.60</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.20</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>16</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">1912.08.10</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:23:00 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">40.60</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.10</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:30:00 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">40.60</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.10</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.2</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">1912.08.11</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:19:04 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">40.60</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.20</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>30</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.9</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:20:00 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">40.60</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.10</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.5</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">1912.09.16</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:04:02 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">40.10</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">26.80</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>30</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.9</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">1913.01.27</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:38:36 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">38.38</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">42.23</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>10</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">1914.05.28</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:27:30 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">39.84</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">35.80</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>10</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">1914.10.03</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:07:02 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">37.70</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">30.40</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>14</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:23:00 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">38.00</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">30.00</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>15</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>0.7</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">2017.07.21</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:50:30 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">36.98</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.38</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>11.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:55:25 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">36.99</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.33</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>12.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.6</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">2017.07.22</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:09:20 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">36.94</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.25</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>8</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.5</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.9</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:12:32 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">40.02</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.14</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>13.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>4.3</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">2017.07.25</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:13:24 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">38.00</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">38.42</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">2017.07.26</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:50:05 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">40.76</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">32.87</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.7</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>2.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"6\" valign=\"top\">2017.07.29</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:24:11 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">37.12</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">28.59</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>3.9</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>0.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:33:23 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">37.11</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">27.73</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>1.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">2017.07.30</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:21:33 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">37.39</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">31.37</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.5</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">2017.07.31</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">12:11:31 AM</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">37.42</th>\n",
       "      <th rowspan=\"3\" valign=\"top\">31.37</th>\n",
       "      <th>深度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>5.1</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>烈度</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>3.5</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>距离</th>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>6.2</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "      <td>-</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>30186 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "方向                                      east north north_east north_west  \\\n",
       "日期         时间          维度    经度    地震参数                                    \n",
       "1912.08.09 12:29:00 AM 40.60 27.20 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "1912.08.10 12:23:00 AM 40.60 27.10 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "           12:30:00 AM 40.60 27.10 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "1912.08.11 12:19:04 AM 40.60 27.20 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "           12:20:00 AM 40.60 27.10 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "1912.09.16 12:04:02 AM 40.10 26.80 深度      -     -         30          -   \n",
       "                                   烈度      -     -        4.9          -   \n",
       "                                   距离      -     -        4.3          -   \n",
       "1913.01.27 12:38:36 AM 38.38 42.23 深度      -     -          -         10   \n",
       "                                   烈度      -     -          -        5.3   \n",
       "                                   距离      -     -          -        0.5   \n",
       "1914.05.28 12:27:30 AM 39.84 35.80 深度      -     -         10          -   \n",
       "                                   烈度      -     -        5.3          -   \n",
       "                                   距离      -     -          2          -   \n",
       "1914.10.03 12:07:02 AM 37.70 30.40 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "           12:23:00 AM 38.00 30.00 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "...                                      ...   ...        ...        ...   \n",
       "2017.07.21 12:50:30 AM 36.98 27.38 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "           12:55:25 AM 36.99 27.33 深度      -     -       12.2          -   \n",
       "                                   烈度      -     -        3.6          -   \n",
       "                                   距离      -     -          4          -   \n",
       "2017.07.22 12:09:20 AM 36.94 27.25 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "           12:12:32 AM 40.02 27.14 深度      -     -       13.2          -   \n",
       "                                   烈度      -     -        4.3          -   \n",
       "                                   距离      -     -          1          -   \n",
       "2017.07.25 12:13:24 AM 38.00 38.42 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "2017.07.26 12:50:05 AM 40.76 32.87 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "2017.07.29 12:24:11 AM 37.12 28.59 深度      -     5          -          -   \n",
       "                                   烈度      -   3.9          -          -   \n",
       "                                   距离      -   0.5          -          -   \n",
       "           12:33:23 AM 37.11 27.73 深度      -     -        6.5          -   \n",
       "                                   烈度      -     -        3.5          -   \n",
       "                                   距离      -     -        1.2          -   \n",
       "2017.07.30 12:21:33 AM 37.39 31.37 深度      -     -          -          -   \n",
       "                                   烈度      -     -          -          -   \n",
       "                                   距离      -     -          -          -   \n",
       "2017.07.31 12:11:31 AM 37.42 31.37 深度      -     -          -        5.1   \n",
       "                                   烈度      -     -          -        3.5   \n",
       "                                   距离      -     -          -        6.2   \n",
       "\n",
       "方向                                      south south_east south_west west  \n",
       "日期         时间          维度    经度    地震参数                                   \n",
       "1912.08.09 12:29:00 AM 40.60 27.20 深度       -         16          -    -  \n",
       "                                   烈度       -        6.7          -    -  \n",
       "                                   距离       -        4.3          -    -  \n",
       "1912.08.10 12:23:00 AM 40.60 27.10 深度       -          -         15    -  \n",
       "                                   烈度       -          -          6    -  \n",
       "                                   距离       -          -          2    -  \n",
       "           12:30:00 AM 40.60 27.10 深度       -          -         15    -  \n",
       "                                   烈度       -          -        5.2    -  \n",
       "                                   距离       -          -          2    -  \n",
       "1912.08.11 12:19:04 AM 40.60 27.20 深度       -         30          -    -  \n",
       "                                   烈度       -        4.9          -    -  \n",
       "                                   距离       -        4.3          -    -  \n",
       "           12:20:00 AM 40.60 27.10 深度       -          -         15    -  \n",
       "                                   烈度       -          -        4.5    -  \n",
       "                                   距离       -          -          2    -  \n",
       "1912.09.16 12:04:02 AM 40.10 26.80 深度       -          -          -    -  \n",
       "                                   烈度       -          -          -    -  \n",
       "                                   距离       -          -          -    -  \n",
       "1913.01.27 12:38:36 AM 38.38 42.23 深度       -          -          -    -  \n",
       "                                   烈度       -          -          -    -  \n",
       "                                   距离       -          -          -    -  \n",
       "1914.05.28 12:27:30 AM 39.84 35.80 深度       -          -          -    -  \n",
       "                                   烈度       -          -          -    -  \n",
       "                                   距离       -          -          -    -  \n",
       "1914.10.03 12:07:02 AM 37.70 30.40 深度      14          -          -    -  \n",
       "                                   烈度     6.4          -          -    -  \n",
       "                                   距离     0.7          -          -    -  \n",
       "           12:23:00 AM 38.00 30.00 深度       -          -         15    -  \n",
       "                                   烈度       -          -        4.7    -  \n",
       "                                   距离       -          -        0.7    -  \n",
       "...                                       ...        ...        ...  ...  \n",
       "2017.07.21 12:50:30 AM 36.98 27.38 深度       -       11.6          -    -  \n",
       "                                   烈度       -          4          -    -  \n",
       "                                   距离       -        5.2          -    -  \n",
       "           12:55:25 AM 36.99 27.33 深度       -          -          -    -  \n",
       "                                   烈度       -          -          -    -  \n",
       "                                   距离       -          -          -    -  \n",
       "2017.07.22 12:09:20 AM 36.94 27.25 深度       -          -          8    -  \n",
       "                                   烈度       -          -        4.5    -  \n",
       "                                   距离       -          -        4.9    -  \n",
       "           12:12:32 AM 40.02 27.14 深度       -          -          -    -  \n",
       "                                   烈度       -          -          -    -  \n",
       "                                   距离       -          -          -    -  \n",
       "2017.07.25 12:13:24 AM 38.00 38.42 深度       -          -          -  1.4  \n",
       "                                   烈度       -          -          -  3.6  \n",
       "                                   距离       -          -          -  1.8  \n",
       "2017.07.26 12:50:05 AM 40.76 32.87 深度       -          5          -    -  \n",
       "                                   烈度       -        3.7          -    -  \n",
       "                                   距离       -        2.1          -    -  \n",
       "2017.07.29 12:24:11 AM 37.12 28.59 深度       -          -          -    -  \n",
       "                                   烈度       -          -          -    -  \n",
       "                                   距离       -          -          -    -  \n",
       "           12:33:23 AM 37.11 27.73 深度       -          -          -    -  \n",
       "                                   烈度       -          -          -    -  \n",
       "                                   距离       -          -          -    -  \n",
       "2017.07.30 12:21:33 AM 37.39 31.37 深度       -          -          5    -  \n",
       "                                   烈度       -          -        3.5    -  \n",
       "                                   距离       -          -          6    -  \n",
       "2017.07.31 12:11:31 AM 37.42 31.37 深度       -          -          -    -  \n",
       "                                   烈度       -          -          -    -  \n",
       "                                   距离       -          -          -    -  \n",
       "\n",
       "[30186 rows x 8 columns]"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#但需要把距离、深度和烈度三个属性压缩\n",
    "#stack函数将横向的索引放到纵向\n",
    "pd.pivot_table(df,index=['日期','时间','维度','经度']\n",
    "            ,columns='方向'\n",
    "            ,values=['烈度','深度','距离'],fill_value='-').stack(0).rename_axis(index={None:'地震参数'})"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#第二问 用到再学"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
